bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/whiteboard/service.js

30 lines
832 B
JavaScript
Raw Normal View History

import Shapes from '/imports/api/shapes';
import Presentations from '/imports/api/presentations';
import Slides from '/imports/api/slides';
let getWhiteboardData = () => {
2016-05-10 06:06:03 +08:00
let currentPresentation, currentSlide, presentationId, shapes, ref;
currentPresentation = Presentations.findOne({
2016-05-10 06:06:03 +08:00
'presentation.current': true,
});
presentationId = currentPresentation != null ? (ref = currentPresentation.presentation) != null ? ref.id : void 0 : void 0;
currentSlide = Slides.findOne({
presentationId: presentationId,
'slide.current': true,
});
2016-05-10 06:06:03 +08:00
if (currentSlide != null) {
shapes = Shapes.find({
2016-05-10 06:06:03 +08:00
whiteboardId: currentSlide.slide.id,
}).fetch();
}
return {
current_slide: currentSlide,
shapes: shapes,
};
2016-05-10 06:06:03 +08:00
};
export default {
getWhiteboardData,
};