novu
novu copied to clipboard
🐛 Bug Report: Pagination Issue in React component
📜 Description
Page number not reset to 0 after calling refetch method of`useNotification.
👟 Reproduction steps
Call fetchNextPage
several times, After that call refetch
after that again call fetchNextPage
. Page will be same as old page number.
👍 Expected behavior
refetch
should also reset the page number.
👎 Actual Behavior with Screenshots
Calling the last page which was called earlier.
💻 Operating system
MacOS
🤖 Node Version
18.6.0
📃 Provide any additional context for the Bug.
No response
👀 Have you spent some time to check if this bug has been raised before?
- [X] I checked and didn't find similar issue
🏢 Have you read the Contributing Guidelines?
- [X] I have read the Contributing Guidelines
Are you willing to submit PR?
No response
Hey, @singhgulshan, I could not reproduce that behavior, though whenever I call refetch
, it does go to page 0. It seems right in most cases, but let's say a user marks a notification as seen in a page different from 0. The markAsSeen
method is called and the notification box refetches the data so the user can be sure he marked that notification as seen. The issue is that it resets the page to 0 automatically, and I believe that is where the problem is situated.
It would be great if Novu provided a way for us to access a specific page on refetch. Something like this:
function refetch({ page: number }) {
// Refetches on desired page
}
@JoaoMagnago Would you mind to create a feature request for this?
@JoaoMagnago Would you mind to create a feature request for this?
Hey, @jainpawan21!
Sorry for the delay. I have just created a Feature Request regarding that matter here.
Thank you for the attention and support.
Thank you @JoaoMagnago will close this one here in favor of the newly created one.