Move every CardCommentReactions.findOne(idOrFirstObjectSelector, options) to the ReactiveCache

This commit is contained in:
Martin Filser 2023-02-05 00:10:46 +01:00
parent f5796faa84
commit e30edce73e
2 changed files with 52 additions and 2 deletions

View file

@ -98,7 +98,7 @@ CardComments.helpers({
},
reactions() {
const cardCommentReactions = CardCommentReactions.findOne({cardCommentId: this._id});
const cardCommentReactions = ReactiveCache.getCardCommentReaction({cardCommentId: this._id});
return !!cardCommentReactions ? cardCommentReactions.reactions : [];
},
@ -107,7 +107,7 @@ CardComments.helpers({
return false;
} else {
const cardCommentReactions = CardCommentReactions.findOne({cardCommentId: this._id});
const cardCommentReactions = ReactiveCache.getCardCommentReaction({cardCommentId: this._id});
const reactions = !!cardCommentReactions ? cardCommentReactions.reactions : [];
const userId = Meteor.userId();
const reaction = reactions.find(r => r.reactionCodepoint === reactionCodepoint);