Merge pull request #7354 from Tainan404/attempt-fix-tex-annotation

Fix text annotation
This commit is contained in:
Anton Georgiev 2019-05-07 10:57:10 -04:00 committed by GitHub
commit be5ccc2abd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -46,7 +46,7 @@ export default withTracker(() => {
const subscriptionsHandlers = SUBSCRIPTIONS.map(name => Meteor.subscribe(name, credentials, subscriptionErrorHandler));
let groupChatMessageHandler = {};
let annotationsHandler = {};
// let annotationsHandler = {};
const chats = GroupChat.find({
$or: [
@ -71,22 +71,22 @@ export default withTracker(() => {
Meteor.subscribe('meetings', credentials, mappedUser.isModerator, subscriptionErrorHandler);
}
annotationsHandler = Meteor.subscribe('annotations', credentials, {
const annotationsHandler = Meteor.subscribe('annotations', credentials, {
onReady: () => {
const activeTextShapeId = AnnotationsTextService.activeTextShapeId();
AnnotationsLocal.remove({ id: { $ne: `${activeTextShapeId}-fake` } });
Annotations.find({ id: { $ne: activeTextShapeId } }, { reactive: false }).forEach((a) => {
try {
AnnotationsLocal.insert(a);
} catch (e) {
// TODO
}
});
annotationsHandler.stop();
},
...subscriptionErrorHandler,
});
Annotations.find({ meetingId: Auth.meetingID }).observe({
added(doc) {
AnnotationsLocal.insert(doc);
},
});
subscriptionsHandlers.push(annotationsHandler);
const ready = subscriptionsHandlers.every(handler => handler.ready());
return {