From 3d2b7f683cc58d4a0a06d27a505bdf2057511e96 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Wed, 1 Feb 2023 02:09:07 +0800 Subject: [PATCH] Fix notifications grouping bug --- src/pages/notifications.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/notifications.jsx b/src/pages/notifications.jsx index 4d6a4bf3..a7c58238 100644 --- a/src/pages/notifications.jsx +++ b/src/pages/notifications.jsx @@ -445,9 +445,9 @@ function groupNotifications(notifications) { const cleanNotifications = []; for (let i = 0, j = 0; i < notifications.length; i++) { const notification = notifications[i]; - const { status, account, type, created_at } = notification; - const createdAt = new Date(created_at).toLocaleDateString(); - const key = `${status?.id}-${type}-${createdAt}`; + const { status, account, type, createdAt } = notification; + const date = new Date(createdAt).toLocaleDateString(); + const key = `${status?.id}-${type}-${date}`; const mappedNotification = notificationsMap[key]; if (mappedNotification?.account) { mappedNotification._accounts.push(account);