summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2018-10-16 13:52:45 +0300
committerLauri Ojansivu <x@xet7.org>2018-10-16 13:52:45 +0300
commit849f15ceee8f40514fe75cbc0b8492394989b2b6 (patch)
treeef6d33a31ddab2dd5b12f477b4e739391a39c7c6
parentf5125b76bcdaa7afda065035786c6bd9b1c04026 (diff)
downloadwekan-849f15ceee8f40514fe75cbc0b8492394989b2b6.tar.gz
wekan-849f15ceee8f40514fe75cbc0b8492394989b2b6.tar.bz2
wekan-849f15ceee8f40514fe75cbc0b8492394989b2b6.zip
- Fix: Update broke the ability to mute notifications;
- Automatically close the sidebar. Thanks to Akuket ! Closes #1952
-rw-r--r--client/components/sidebar/sidebar.js3
-rw-r--r--models/activities.js5
-rw-r--r--server/notifications/notifications.js14
3 files changed, 8 insertions, 14 deletions
diff --git a/client/components/sidebar/sidebar.js b/client/components/sidebar/sidebar.js
index 5d34c4a8..83b12666 100644
--- a/client/components/sidebar/sidebar.js
+++ b/client/components/sidebar/sidebar.js
@@ -16,8 +16,7 @@ BlazeComponent.extendComponent({
},
onCreated() {
- const initOpen = Utils.isMiniScreen() ? false : (!Session.get('currentCard'));
- this._isOpen = new ReactiveVar(initOpen);
+ this._isOpen = new ReactiveVar(false);
this._view = new ReactiveVar(defaultView);
Sidebar = this;
},
diff --git a/models/activities.js b/models/activities.js
index 577aab68..e49cbf0a 100644
--- a/models/activities.js
+++ b/models/activities.js
@@ -143,10 +143,11 @@ if (Meteor.isServer) {
}
if (board) {
const watchingUsers = _.pluck(_.where(board.watchers, {level: 'watching'}), 'userId');
- watchers = _.union(watchers, watchingUsers || []);
+ const trackingUsers = _.pluck(_.where(board.watchers, {level: 'tracking'}), 'userId');
+ watchers = _.union(watchers, watchingUsers, _.intersection(participants, trackingUsers));
}
- Notifications.getUsers(participants, watchers).forEach((user) => {
+ Notifications.getUsers(watchers).forEach((user) => {
Notifications.notify(user, title, description, params);
});
diff --git a/server/notifications/notifications.js b/server/notifications/notifications.js
index 72692ef8..19d43bc4 100644
--- a/server/notifications/notifications.js
+++ b/server/notifications/notifications.js
@@ -20,19 +20,13 @@ Notifications = {
},
// filter recipients according to user settings for notification
- getUsers: (participants, watchers) => {
- const userMap = {};
- participants.forEach((userId) => {
- if (userMap[userId]) return;
- const user = Users.findOne(userId);
- userMap[userId] = user;
- });
+ getUsers: (watchers) => {
+ const users = [];
watchers.forEach((userId) => {
- if (userMap[userId]) return;
const user = Users.findOne(userId);
- userMap[userId] = user;
+ if (user) users.push(user);
});
- return _.map(userMap, (v) => v);
+ return users;
},
notify: (user, title, description, params) => {