Skip to content

Commit

Permalink
Remove initialData in nonce and session
Browse files Browse the repository at this point in the history
It appears that in @tanstack/react-query v5 and up the query will not be fetched on mount if `initialData` is set. This means that the `ckSiweNonce` and `ckSiweSession` queries don't fire until their respective intervals have elapsed.

This commit removes the `initialData` for both of these queries in order to restore previous functionality.
  • Loading branch information
JamieLottering committed Feb 9, 2024
1 parent 5d27392 commit 5d48904
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions packages/connectkit/src/siwe/SIWEProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,12 @@ export const SIWEProvider = ({
const nonce = useQuery({
queryKey: ['ckSiweNonce'],
queryFn: () => siweConfig.getNonce(),
initialData: null,
refetchInterval: nonceRefetchInterval,
});

const session = useQuery({
queryKey: ['ckSiweSession'],
queryFn: () => siweConfig.getSession(),
initialData: null,
refetchInterval: sessionRefetchInterval,
});

Expand Down

0 comments on commit 5d48904

Please sign in to comment.