浏览代码

fix error from notifications subscriptions

Jonathan Baird 5 年之前
父节点
当前提交
8ea86ae0b9
共有 1 个文件被更改,包括 2 次插入1 次删除
  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) },
   });
 }