mirror of
https://github.com/wekan/wekan.git
synced 2026-02-21 07:24:07 +01:00
Fix Notifications from not allowed Boards.
Thanks to FK-PATZ3 and xet7 ! Fixes #6103
This commit is contained in:
parent
6903e12112
commit
a34c2f35a6
2 changed files with 20 additions and 1 deletions
|
|
@ -2098,6 +2098,10 @@ Cards.helpers({
|
|||
);
|
||||
|
||||
const newBoard = ReactiveCache.getBoard(boardId);
|
||||
const allowedMemberIds = _.pluck(
|
||||
_.filter(newBoard.members || [], member => member.isActive === true),
|
||||
'userId',
|
||||
);
|
||||
const newBoardLabels = newBoard.labels;
|
||||
const newCardLabelIds = _.pluck(
|
||||
_.filter(newBoardLabels, label => {
|
||||
|
|
@ -2119,6 +2123,18 @@ Cards.helpers({
|
|||
if (!Array.isArray(mutatedFields.customFields)) {
|
||||
mutatedFields.customFields = [];
|
||||
}
|
||||
|
||||
const currentMembers = Array.isArray(this.members) ? this.members : [];
|
||||
const filteredMembers = currentMembers.filter(memberId => allowedMemberIds.includes(memberId));
|
||||
if (_.difference(currentMembers, filteredMembers).length > 0) {
|
||||
mutatedFields.members = filteredMembers;
|
||||
}
|
||||
|
||||
const currentWatchers = Array.isArray(this.watchers) ? this.watchers : [];
|
||||
const filteredWatchers = currentWatchers.filter(watcherId => allowedMemberIds.includes(watcherId));
|
||||
if (_.difference(currentWatchers, filteredWatchers).length > 0) {
|
||||
mutatedFields.watchers = filteredWatchers;
|
||||
}
|
||||
}
|
||||
|
||||
Cards.updateAsync(this._id, { $set: mutatedFields });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue