mirror of
https://github.com/wekan/wekan.git
synced 2026-01-03 16:18:49 +01:00
bugfix: only care active members, also optimize some code
This commit is contained in:
parent
b719968df5
commit
672c21bfe0
9 changed files with 62 additions and 78 deletions
|
|
@ -12,16 +12,12 @@ if (Meteor.isClient) {
|
|||
Users.helpers({
|
||||
isBoardMember() {
|
||||
const board = Boards.findOne(Session.get('currentBoard'));
|
||||
return board &&
|
||||
_.contains(_.pluck(board.members, 'userId'), this._id) &&
|
||||
_.where(board.members, {userId: this._id})[0].isActive;
|
||||
return board && board.hasMember(this._id);
|
||||
},
|
||||
|
||||
isBoardAdmin() {
|
||||
const board = Boards.findOne(Session.get('currentBoard'));
|
||||
return board &&
|
||||
this.isBoardMember(board) &&
|
||||
_.where(board.members, {userId: this._id})[0].isAdmin;
|
||||
return board && board.hasAdmin(this._id);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue