Remove stale time to force refreshed, start using the cached result

This commit is contained in:
Jackson Harper 2024-08-19 13:00:14 +08:00
parent 4bfcbde65d
commit e6a220c984

View file

@ -260,8 +260,7 @@ export function useGetLibraryItems(
if (idx > -1 && idx < cached.pages.length) {
const cachedResult = cached.pages[idx]
console.log('found cached page result: ', cachedResult)
// check
// return cachedResult
return cachedResult
}
}
}
@ -301,7 +300,6 @@ export function useGetLibraryItems(
},
enabled,
initialPageParam: '0',
staleTime: 10_000,
getNextPageParam: (lastPage: LibraryItems, pages) => {
return lastPage.pageInfo.hasNextPage
? lastPage?.pageInfo?.endCursor