Merge pull request #2253 from justinr1234/devel

Fix watchers undefined #2252
This commit is contained in:
Lauri Ojansivu 2019-03-12 22:57:38 +02:00 committed by GitHub
commit 1158cd42cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -113,9 +113,11 @@ if (Meteor.isServer) {
}
if (activity.oldBoardId) {
const oldBoard = activity.oldBoard();
watchers = _.union(watchers, oldBoard.watchers || []);
params.oldBoard = oldBoard.title;
params.oldBoardId = activity.oldBoardId;
if (oldBoard) {
watchers = _.union(watchers, oldBoard.watchers || []);
params.oldBoard = oldBoard.title;
params.oldBoardId = activity.oldBoardId;
}
}
if (activity.memberId) {
participants = _.union(participants, [activity.memberId]);
@ -129,15 +131,19 @@ if (Meteor.isServer) {
}
if (activity.oldListId) {
const oldList = activity.oldList();
watchers = _.union(watchers, oldList.watchers || []);
params.oldList = oldList.title;
params.oldListId = activity.oldListId;
if (oldList) {
watchers = _.union(watchers, oldList.watchers || []);
params.oldList = oldList.title;
params.oldListId = activity.oldListId;
}
}
if (activity.oldSwimlaneId) {
const oldSwimlane = activity.oldSwimlane();
watchers = _.union(watchers, oldSwimlane.watchers || []);
params.oldSwimlane = oldSwimlane.title;
params.oldSwimlaneId = activity.oldSwimlaneId;
if (oldSwimlane) {
watchers = _.union(watchers, oldSwimlane.watchers || []);
params.oldSwimlane = oldSwimlane.title;
params.oldSwimlaneId = activity.oldSwimlaneId;
}
}
if (activity.cardId) {
const card = activity.card();