mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-07 04:20:12 +02:00
fix infinite loader potentially refetching count multiple times on query change
This commit is contained in:
@@ -186,10 +186,9 @@ export const useItemListInfiniteLoader = ({
|
||||
lastFetchedPageRef.current = -1;
|
||||
currentVisibleRangeRef.current = null;
|
||||
|
||||
// Invalidate and wait for count query to refetch (this will suspend via useSuspenseQuery)
|
||||
await queryClient.refetchQueries({
|
||||
// Invalidate and wait for count query to refetch
|
||||
await queryClient.ensureQueryData({
|
||||
queryKey: countQueryKey,
|
||||
type: 'active',
|
||||
});
|
||||
|
||||
// Fetch the first page after count is refetched
|
||||
|
||||
Reference in New Issue
Block a user