-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix search debounce #187
base: main
Are you sure you want to change the base?
Fix search debounce #187
Conversation
@@ -107,44 +107,49 @@ export default function AVSList() { | |||
|
|||
const handlePageClick = useCallback( | |||
page => { | |||
setSearchParams({ page: page.toString() }); | |||
searchParams.set('page', page.toString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to copy it before mutating?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The multiple API requests bug is fixed but now if I change the page and try to go back using browser's back button, I have to click 2 times to return to the previous page.
Screen.Recording.2024-09-13.at.5.43.18.PM.mov
@rubo does the same behaviour happen for AVS details operator table? I implemented the search functionality slightly differently there |
@vincenthongzy I checked; it works fine. Maybe we can apply that approach here as well to avoid issues with navigation. |
Fixed AVS search debounce not to make many requests in a row when search parameters changed. This has been caused by incorrect dependency configuration in
useEffect
. Therefore,useEffect
is now split into 2 different ones with different set of dependencies.The fix should be applied to other views as well.