diff --git a/src/context/notifications.tsx b/src/context/notifications.tsx index f104faa6..bdbc1bb2 100644 --- a/src/context/notifications.tsx +++ b/src/context/notifications.tsx @@ -47,7 +47,11 @@ export const NotificationsProvider = (props: { children: JSX.Element }) => { const loadNotificationsGrouped = async (options: { after: number; limit?: number; offset?: number }) => { if (isAuthenticated() && notifierClient?.private) { - const { notifications: groups, total, unread } = await notifierClient.getNotifications(options) + const notificationsResult = await notifierClient.getNotifications(options) + const groups = notificationsResult?.notifications || [] + const total = notificationsResult?.total || 0 + const unread = notificationsResult?.unread || 0 + const newGroupsEntries = groups.reduce((acc, group: NotificationGroup) => { acc[group.id] = group return acc