no more stale swr any longer

This commit is contained in:
spencerwooo
2022-01-06 21:16:20 +08:00
parent b451f09aeb
commit c34fa086fb
+7 -6
View File
@@ -56,10 +56,11 @@ export function useProtectedSWRInfinite(path: string = '') {
return [`/api?path=${path}&next=${previousPageData.next}`, hashedToken] return [`/api?path=${path}&next=${previousPageData.next}`, hashedToken]
} }
const revalidationOptions = { // const revalidationOptions = {
revalidateOnMount: !(cache.has(`arg@"/api?path=${path}"@null`) || cache.has(`/api?path=${path}`)), // revalidateOnMount: !(cache.has(`arg@"/api?path=${path}"@null`) || cache.has(`/api?path=${path}`)),
revalidateOnFocus: false, // revalidateOnFocus: false,
revalidateOnReconnect: true, // revalidateOnReconnect: true,
} // }
return useSWRInfinite(getNextKey, fetcher, revalidationOptions) // return useSWRInfinite(getNextKey, fetcher, revalidationOptions)
return useSWRInfinite(getNextKey, fetcher)
} }