From e2d77100357f85d3806e24705939504a2e947668 Mon Sep 17 00:00:00 2001 From: Untone Date: Fri, 19 Jan 2024 21:46:13 +0300 Subject: [PATCH] notifications-fix --- .../NotificationView/NotificationGroup.tsx | 2 +- src/context/notifications.tsx | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/NotificationsPanel/NotificationView/NotificationGroup.tsx b/src/components/NotificationsPanel/NotificationView/NotificationGroup.tsx index ee0f4c87..85ccd969 100644 --- a/src/components/NotificationsPanel/NotificationView/NotificationGroup.tsx +++ b/src/components/NotificationsPanel/NotificationView/NotificationGroup.tsx @@ -64,7 +64,7 @@ export const NotificationGroup = (props: NotificationGroupProps) => { return ( <> - + {(n: Group) => ( <> {t(reactionsCaption(n.id), { commentsCount: n.reactions.length })}{' '} diff --git a/src/context/notifications.tsx b/src/context/notifications.tsx index cffeff74..f104faa6 100644 --- a/src/context/notifications.tsx +++ b/src/context/notifications.tsx @@ -47,7 +47,7 @@ export const NotificationsProvider = (props: { children: JSX.Element }) => { const loadNotificationsGrouped = async (options: { after: number; limit?: number; offset?: number }) => { if (isAuthenticated() && notifierClient?.private) { - const { notifications: groups, unread, total } = await notifierClient.getNotifications(options) + const { notifications: groups, total, unread } = await notifierClient.getNotifications(options) const newGroupsEntries = groups.reduce((acc, group: NotificationGroup) => { acc[group.id] = group return acc @@ -58,9 +58,8 @@ export const NotificationsProvider = (props: { children: JSX.Element }) => { setNotificationEntities(newGroupsEntries) console.debug(`[context.notifications] groups updated`, groups) return groups - } else { - return [] } + return [] } const sortedNotifications = createMemo(() => {