Move every Meteor.user() to the ReactiveCache

This commit is contained in:
Martin Filser 2023-01-16 23:00:10 +01:00
parent 6e1ef3d94a
commit 5e3a9dc059
42 changed files with 211 additions and 252 deletions

View file

@ -1,3 +1,5 @@
import { ReactiveCache } from '/imports/reactiveCache';
// We use these when displaying notifications in the notificationsDrawer
// gets all activities associated with the current user
@ -94,7 +96,7 @@ Meteor.publish('notificationUsers', function() {
});
function activities() {
const activityIds = Meteor.user()?.profile?.notifications?.map(v => v.activity) || [];
const activityIds = ReactiveCache.getCurrentUser()?.profile?.notifications?.map(v => v.activity) || [];
let ret = [];
if (activityIds.length > 0) {
ret = Activities.find({