From 00e60ff8559997bc6c5711076f2b45cc4a59f613 Mon Sep 17 00:00:00 2001 From: Martin Filser Date: Tue, 7 Nov 2023 19:07:34 +0100 Subject: [PATCH] notifications are now always ordered from newest to oldest activity --- models/users.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/models/users.js b/models/users.js index 392ca4e91..d50c402df 100644 --- a/models/users.js +++ b/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() {