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

34 lines
716 B
JavaScript
Raw Normal View History

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