From 52d688885d65c9304210ccd9f8d6aa09f34e9f56 Mon Sep 17 00:00:00 2001 From: Ian Philips Date: Mon, 11 Jul 2022 08:11:52 -0600 Subject: [PATCH] Group income notifs by source title --- web/pages/notifications.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/web/pages/notifications.tsx b/web/pages/notifications.tsx index 8cdd2cb1..191747fe 100644 --- a/web/pages/notifications.tsx +++ b/web/pages/notifications.tsx @@ -179,15 +179,16 @@ function IncomeNotificationGroupItem(props: { (n) => n.sourceType ) for (const sourceType in groupedNotificationsBySourceType) { - const groupedNotificationsByContractId = groupBy( + // Source title splits by contracts and groups + const groupedNotificationsBySourceTitle = groupBy( groupedNotificationsBySourceType[sourceType], (notification) => { - return notification.sourceContractId + return notification.sourceTitle } ) - for (const contractId in groupedNotificationsByContractId) { + for (const contractId in groupedNotificationsBySourceTitle) { const notificationsForContractId = - groupedNotificationsByContractId[contractId] + groupedNotificationsBySourceTitle[contractId] if (notificationsForContractId.length === 1) { newNotifications.push(notificationsForContractId[0]) continue