mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-08 21:10:12 +02:00
Prevent double fetching when force refreshing paginated views (#1637)
* Prevent double fetching when force refreshing paginated views * remove await from infinite list loader query invalidation * add mutation and loading state to list refresh * add non-suspense query to list genre filters to add loading state * remove list count data set on random queries --------- Co-authored-by: jeffvli <jeffvictorli@gmail.com>
This commit is contained in:
@@ -62,7 +62,11 @@ export const getOptimizedListCount = async <
|
||||
query: pageQuery,
|
||||
});
|
||||
|
||||
client.setQueryData(pageQueryKey, pageResult);
|
||||
const keyContainsRandom = JSON.stringify(pageQueryKey).toLowerCase().includes('random');
|
||||
|
||||
if (!keyContainsRandom) {
|
||||
client.setQueryData(pageQueryKey, pageResult);
|
||||
}
|
||||
|
||||
return pageResult.totalRecordCount ?? 0;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user