We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f2675be commit 5cfa44eCopy full SHA for 5cfa44e
src/components/PaginatedNavigation.tsx
@@ -23,8 +23,9 @@ export const PaginatedNavigation = ({
23
// Keep stable totalPages to prevent pagination from disappearing during loading
24
const lastValidTotalPagesRef = useRef<number>(1);
25
26
- // Only update the ref if we have a valid totalPages (> 0)
27
- if (totalPages > 0) {
+ // Only update the ref if we have a valid totalPages that's greater than or equal to the current one
+ // This prevents the pagination from shrinking during loading states
28
+ if (totalPages > 0 && totalPages >= lastValidTotalPagesRef.current) {
29
lastValidTotalPagesRef.current = totalPages;
30
}
31
0 commit comments