feat: prevent persistent caching of multiple pages

This commit is contained in:
DIYgod 2023-04-06 00:37:52 +01:00
parent 653cf39d24
commit e00be336bd
No known key found for this signature in database
1 changed files with 14 additions and 1 deletions

View File

@ -41,7 +41,20 @@ function MyApp({ Component, pageProps }: any) {
<WagmiConfig client={wagmiClient}>
<PersistQueryClientProvider
client={queryClient}
persistOptions={{ persister }}
persistOptions={{
persister,
dehydrateOptions: {
shouldDehydrateQuery: (query) => {
const queryIsReadyForPersistance =
query.state.status === "success"
if (queryIsReadyForPersistance) {
return !((query.state?.data as any)?.pages?.length > 1)
} else {
return false
}
},
},
}}
>
<ConnectKitProvider
ipfsLinkToHttpLink={toGateway}