N
Novu•16mo ago
Jauhari

Notification Center Isn't working properly

Hi, i have some issues while using notification-center first one is only 10 notification fetched and the value of
hasNextPage
hasNextPage
is always false so i cant fetch the next notifications but the unread count says it has more than 100+ notifications second one is when i trigger the function of
markAllNotificationsAsRead
markAllNotificationsAsRead
it only read & seen the fetched notification Notification center version: 0.19
7 Replies
Tomer Barnea
Tomer Barnea•16mo ago
Hey @jauhari. 🙂 Sorry about that. @Pawan Jain @paweltymczuk can you help us here?
Pawan Jain
Pawan Jain•16mo ago
Hi @jauhari. Are you self hosting Novu? which hook you are using to fetch in-app notifications?
Jauhari
JauhariOP•16mo ago
yeah it is self host novu
const {
notifications,
fetchNextPage,
hasNextPage,
markAllNotificationsAsRead,
} = useNotifications()
const {
notifications,
fetchNextPage,
hasNextPage,
markAllNotificationsAsRead,
} = useNotifications()
i use that with these configuration
const novuFetchStrategy = {
fetchNotifications: true,
fetchUnseenCount: true,
}

initialFetchingStrategy={novuFetchStrategy}
const novuFetchStrategy = {
fetchNotifications: true,
fetchUnseenCount: true,
}

initialFetchingStrategy={novuFetchStrategy}
Paweł T.
Paweł T.•16mo ago
hello @jauhari.! 👋 If you would like to fetch more notifications, you can do this by defining stores property on the NovuProvider like this: stores={[{ storeId: 'default', query: { limit: 20 }}]}. I have checked quickly the fetchNextPage and hasNextPage functionality, and it seems like they are working well for me. Same about the markAllNotificationsAsRead. Are you sure that Novu + Notification Center are both v0.19.0? because it seems to me that you are running older version of Novu < v0.19.0
Jauhari
JauhariOP•16mo ago
i reinstalled the library then the notification working fine and markAllNotificationsAsRead is also working fine, but sometimes when there is a new notification the notifications isnt sorted but i guess i can manipulate the array first
Paweł T.
Paweł T.•16mo ago
if you use the useUnseenCount hook, then all the queries should be refetched automatically and notifications should be shown in the correct order
Jauhari
JauhariOP•16mo ago
i see, i'll try that thanks @paweltymczuk
Want results from more Discord servers?
Add your server