2
0
Эх сурвалжийг харах

Merge branch 'Akuket-edge' into edge

Lauri Ojansivu 6 жил өмнө
parent
commit
81f98e2da1

+ 1 - 2
client/components/sidebar/sidebar.js

@@ -16,8 +16,7 @@ BlazeComponent.extendComponent({
   },
   },
 
 
   onCreated() {
   onCreated() {
-    const initOpen = Utils.isMiniScreen() ? false : (!Session.get('currentCard'));
-    this._isOpen = new ReactiveVar(initOpen);
+    this._isOpen = new ReactiveVar(false);
     this._view = new ReactiveVar(defaultView);
     this._view = new ReactiveVar(defaultView);
     Sidebar = this;
     Sidebar = this;
   },
   },

+ 3 - 2
models/activities.js

@@ -151,10 +151,11 @@ if (Meteor.isServer) {
     }
     }
     if (board) {
     if (board) {
       const watchingUsers = _.pluck(_.where(board.watchers, {level: 'watching'}), 'userId');
       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);
       Notifications.notify(user, title, description, params);
     });
     });
 
 

+ 4 - 11
server/notifications/notifications.js

@@ -19,20 +19,13 @@ Notifications = {
       delete notifyServices[serviceName];
       delete notifyServices[serviceName];
   },
   },
 
 
-  // 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) => {
     watchers.forEach((userId) => {
-      if (userMap[userId]) return;
       const user = Users.findOne(userId);
       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) => {
   notify: (user, title, description, params) => {