瀏覽代碼

notifications are now displayed correctly again

Martin Filser 1 年之前
父節點
當前提交
402528d97e
共有 2 個文件被更改,包括 4 次插入2 次删除
  1. 1 1
      client/components/notifications/notificationsDrawer.jade
  2. 3 1
      models/users.js

+ 1 - 1
client/components/notifications/notificationsDrawer.jade

@@ -11,7 +11,7 @@ template(name='notificationsDrawer')
       a.fa.fa-times-thin.close
       a.fa.fa-times-thin.close
     ul.notifications
     ul.notifications
       each transformedProfile.notifications
       each transformedProfile.notifications
-        +notification(activityData=activity index=dbIndex read=read)
+        +notification(activityData=activityObj index=dbIndex read=read)
     if($gt unreadNotifications 0)
     if($gt unreadNotifications 0)
       a.all-read {{_ 'mark-all-as-read'}}
       a.all-read {{_ 'mark-all-as-read'}}
     if ($and ($.Session.get 'showReadNotifications') ($gt readNotifications 0))
     if ($and ($.Session.get 'showReadNotifications') ($gt readNotifications 0))

+ 3 - 1
models/users.js

@@ -852,7 +852,9 @@ Users.helpers({
       const notification = notifications[index];
       const notification = notifications[index];
       // this preserves their db sort order for editing
       // this preserves their db sort order for editing
       notification.dbIndex = index;
       notification.dbIndex = index;
-      notification.activity = ReactiveCache.getActivity(notification.activity);
+      if (!notification.activityObj && typeof(notification.activity) === 'string') {
+        notification.activityObj = ReactiveCache.getActivity(notification.activity);
+      }
     }
     }
     // this sorts them newest to oldest to match Trello's behavior
     // this sorts them newest to oldest to match Trello's behavior
     notifications.reverse();
     notifications.reverse();