From ca98863c0124c1bafe7fc907248f0bf8b5766e38 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Thu, 15 Dec 2022 13:11:28 +0800 Subject: [PATCH] Fix bug when the first notification is already a grouped one --- src/pages/notifications.jsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pages/notifications.jsx b/src/pages/notifications.jsx index 3ff045ab..7652878f 100644 --- a/src/pages/notifications.jsx +++ b/src/pages/notifications.jsx @@ -147,7 +147,12 @@ function NotificationsList({ notifications, emptyCopy }) { // Create new flat list of notifications // Combine sibling notifications based on type and status id, ignore the id // Concat all notification.account into an array of _accounts - const cleanNotifications = [notifications[0]]; + const cleanNotifications = [ + { + ...notifications[0], + _accounts: [notifications[0].account], + }, + ]; for (let i = 1, j = 0; i < notifications.length; i++) { const notification = notifications[i]; const cleanNotification = cleanNotifications[j];