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

@ -739,17 +739,12 @@ Boards.helpers({
},
lists() {
//currentUser = Meteor.user();
//if (currentUser) {
// enabled = Meteor.user().hasSortBy();
//}
//return enabled ? this.newestLists() : this.draggableLists();
return this.draggableLists();
},
newestLists() {
// sorted lists from newest to the oldest, by its creation date or its cards' last modification date
const value = Meteor.user()._getListSortBy();
const value = ReactiveCache.getCurrentUser()._getListSortBy();
const sortKey = { starred: -1, [value[0]]: value[1] }; // [["starred",-1],value];
return Lists.find(
{
@ -1299,9 +1294,10 @@ Boards.mutations({
},
setBackgroundImageURL(backgroundImageURL) {
if(Meteor.user().isBoardAdmin()) {
const currentUser = ReactiveCache.getCurrentUser();
if(currentUser.isBoardAdmin()) {
return { $set: { backgroundImageURL } };
} else if (Meteor.user().isAdmin()) {
} else if (currentUser.isAdmin()) {
return { $set: { backgroundImageURL } };
} else {
return false;