disable file listing revalidate, close #317

This commit is contained in:
spencerwooo
2022-01-29 15:11:05 +08:00
parent 89b1ed7dfe
commit 940eef458f
+7 -7
View File
@@ -60,11 +60,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)
return useSWRInfinite(getNextKey, fetcher) return useSWRInfinite(getNextKey, fetcher, revalidationOptions)
} }