mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 23:40:13 +01:00
Move every Users.findOne() to the ReactiveCache
This commit is contained in:
parent
bf48d4371c
commit
6e1ef3d94a
35 changed files with 175 additions and 125 deletions
|
|
@ -170,13 +170,13 @@ EscapeActions.register(
|
|||
|
||||
Template.memberPopup.helpers({
|
||||
user() {
|
||||
return Users.findOne(this.userId);
|
||||
return ReactiveCache.getUser(this.userId);
|
||||
},
|
||||
isBoardAdmin() {
|
||||
return Meteor.user().isBoardAdmin();
|
||||
},
|
||||
memberType() {
|
||||
const type = Users.findOne(this.userId).isBoardAdmin() ? 'admin' : 'normal';
|
||||
const type = ReactiveCache.getUser(this.userId).isBoardAdmin() ? 'admin' : 'normal';
|
||||
if (type === 'normal') {
|
||||
const currentBoard = Utils.getCurrentBoard();
|
||||
const commentOnly = currentBoard.hasCommentOnly(this.userId);
|
||||
|
|
@ -196,7 +196,7 @@ Template.memberPopup.helpers({
|
|||
}
|
||||
},
|
||||
isInvited() {
|
||||
return Users.findOne(this.userId).isInvitedTo(Session.get('currentBoard'));
|
||||
return ReactiveCache.getUser(this.userId).isInvitedTo(Session.get('currentBoard'));
|
||||
},
|
||||
});
|
||||
|
||||
|
|
@ -299,7 +299,7 @@ Template.memberPopup.events({
|
|||
|
||||
Template.removeMemberPopup.helpers({
|
||||
user() {
|
||||
return Users.findOne(this.userId);
|
||||
return ReactiveCache.getUser(this.userId);
|
||||
},
|
||||
board() {
|
||||
return Utils.getCurrentBoard();
|
||||
|
|
@ -1450,7 +1450,7 @@ BlazeComponent.extendComponent({
|
|||
|
||||
isBoardMember() {
|
||||
const userId = this.currentData().__originalId;
|
||||
const user = Users.findOne(userId);
|
||||
const user = ReactiveCache.getUser(userId);
|
||||
return user && user.isBoardMember();
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue