Skip to content

Commit bbcd326

Browse files
committed
fix: correct operations count
1 parent 02a9569 commit bbcd326

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/containers/Operations/useOperationsInfiniteQuery.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,14 @@ export function useOperationsInfiniteQuery({
6363
// Check after data updates
6464
React.useLayoutEffect(() => {
6565
if (!isFetchingNextPage) {
66-
checkAndLoadMorePages();
66+
// RAF to ensure browser has completed layout and paint
67+
const raf = requestAnimationFrame(() => {
68+
checkAndLoadMorePages();
69+
});
70+
return () => cancelAnimationFrame(raf);
6771
}
72+
73+
return undefined;
6874
}, [data, isFetchingNextPage, checkAndLoadMorePages]);
6975

7076
// Scroll handler for infinite scrolling

0 commit comments

Comments
 (0)