Skip to content

Commit

Permalink
add refetch interval for route query
Browse files Browse the repository at this point in the history
  • Loading branch information
yogurtandjam committed Oct 18, 2024
1 parent acecf8f commit 2202ef9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ import { config, privyConfig } from '@/lib/wagmi';
import { RestrictionWarning } from './components/RestrictionWarning';
import { ComplianceStates } from './constants/compliance';
import { DialogTypes } from './constants/dialogs';
import { useSkipClient } from './hooks/transfers/skipClient';
import { assetsQueryFn, chainsQueryFn } from './hooks/transfers/useTransfers';
import { useAnalytics } from './hooks/useAnalytics';
import { useBreakpoints } from './hooks/useBreakpoints';
import { useCommandMenu } from './hooks/useCommandMenu';
Expand Down
4 changes: 3 additions & 1 deletion src/hooks/transfers/useTransfers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ import { useAccounts } from '../useAccounts';
import { useDebounce } from '../useDebounce';
import { useSkipClient } from './skipClient';

const ROUTE_QUERY_REFETCH_INTERVAL = 5_000;

export const chainsQueryFn = async (skipClient: SkipClient) => {
const skipSupportedChains = await skipClient.chains({
includeEVM: true,
Expand Down Expand Up @@ -230,7 +232,7 @@ export const useTransfers = () => {
swapVenues: SWAP_VENUES,
});
},

refetchInterval: ROUTE_QUERY_REFETCH_INTERVAL,
enabled: hasAllParams,
});

Expand Down

0 comments on commit 2202ef9

Please sign in to comment.