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

notifications are now always ordered from newest to oldest activity

Martin Filser 1 жил өмнө
parent
commit
00e60ff855
1 өөрчлөгдсөн 3 нэмэгдсэн , 3 устгасан
  1. 3 3
      models/users.js

+ 3 - 3
models/users.js

@@ -856,9 +856,9 @@ Users.helpers({
         notification.activityObj = ReactiveMiniMongoIndex.getActivityWithId(notification.activity);
       }
     }
-    // this sorts them newest to oldest to match Trello's behavior
-    notifications.reverse();
-    return notifications;
+    // newest first. don't use reverse() because it changes the array inplace, so sometimes the array is reversed twice and oldest items at top again
+    const ret = notifications.toReversed();
+    return ret;
   },
 
   hasShowDesktopDragHandles() {