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

@ -91,9 +91,6 @@ Template.boardOrgRow.helpers({
orgData() {
return Org.findOne(this.orgId);
},
currentUser(){
return Meteor.user();
},
});
Template.boardOrgName.helpers({
@ -153,9 +150,6 @@ Template.boardTeamRow.helpers({
teamData() {
return Team.findOne(this.teamId);
},
currentUser(){
return Meteor.user();
},
});
Template.boardTeamName.helpers({
@ -182,20 +176,20 @@ BlazeComponent.extendComponent({
},
isSelected() {
const userProfile = Meteor.user().profile;
const userProfile = ReactiveCache.getCurrentUser().profile;
const avatarUrl = userProfile && userProfile.avatarUrl;
const currentAvatarUrl = `${this.currentData().link()}?auth=false&brokenIsFine=true`;
return avatarUrl === currentAvatarUrl;
},
noAvatarUrl() {
const userProfile = Meteor.user().profile;
const userProfile = ReactiveCache.getCurrentUser().profile;
const avatarUrl = userProfile && userProfile.avatarUrl;
return !avatarUrl;
},
setAvatar(avatarUrl) {
Meteor.user().setAvatarUrl(avatarUrl);
ReactiveCache.getCurrentUser().setAvatarUrl(avatarUrl);
},
setError(error) {