Browse Source

fix error from notifications subscriptions

Jonathan Baird 5 năm trước cách đây
mục cha
commit
8ea86ae0b9
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      server/publications/notifications.js

+ 2 - 1
server/publications/notifications.js

@@ -94,7 +94,8 @@ Meteor.publish('notificationUsers', function() {
 });
 
 function activities() {
+  const notifications = Meteor.user().profile.notifications || [];
   return Activities.find({
-    _id: { $in: Meteor.user().profile.notifications.map(v => v.activity) },
+    _id: { $in: notifications.map(v => v.activity) },
   });
 }