ec07b4434d
WIP | Use streams to cursor and optimistic updates WIP | Use streamss to whiteboard and optimistic updates WIP | Remove fake delay Add two way batching (server/client client/server) Fix null userId exception and remove logs wip Add two way batching (server/client client/server) for cursor Remove message frequency from draw-listeners component since we handle on message publication Handle clear and undo messages
23 lines
659 B
JavaScript
Executable File
23 lines
659 B
JavaScript
Executable File
import _ from 'lodash';
|
|
import { check } from 'meteor/check';
|
|
import clearAnnotations from '../modifiers/clearAnnotations';
|
|
import addAnnotation from '../modifiers/addAnnotation';
|
|
|
|
export default function handleWhiteboardAnnotations({ body }, meetingId) {
|
|
check(meetingId, String);
|
|
check(body, Object);
|
|
|
|
const { annotations, whiteboardId } = body;
|
|
|
|
check(whiteboardId, String);
|
|
clearAnnotations(meetingId, whiteboardId);
|
|
|
|
const annotationsAdded = [];
|
|
_.each(annotations, (annotation) => {
|
|
const { wbId, userId } = annotation;
|
|
annotationsAdded.push(addAnnotation(meetingId, wbId, userId, annotation));
|
|
});
|
|
|
|
return annotationsAdded;
|
|
}
|