notifications-fix
This commit is contained in:
parent
ae85ec144b
commit
e2d7710035
|
@ -64,7 +64,7 @@ export const NotificationGroup = (props: NotificationGroupProps) => {
|
|||
|
||||
return (
|
||||
<>
|
||||
<For each={props.notifications}>
|
||||
<For each={props.notifications || []}>
|
||||
{(n: Group) => (
|
||||
<>
|
||||
{t(reactionsCaption(n.id), { commentsCount: n.reactions.length })}{' '}
|
||||
|
|
|
@ -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(() => {
|
||||
|
|
Loading…
Reference in New Issue
Block a user