skip wallet fetch for anon users

This commit is contained in:
Riccardo Balbo 2024-10-16 13:06:15 +02:00 committed by k00b
parent 41b86c8251
commit 623b69df3a
1 changed files with 6 additions and 6 deletions

View File

@ -197,6 +197,7 @@ function useConfig (walletDef) {
}, [walletDef, client])
const refreshConfig = useCallback(async () => {
if (!me?.id) return
if (walletDef) {
let newConfig = {}
newConfig = {
@ -467,12 +468,11 @@ export function WalletProvider ({ children }) {
const migratableKeys = !migrationRan.current && !SSR ? Object.keys(window.localStorage).filter(k => k.startsWith('wallet:')) : undefined
const walletList = walletDefs.map(def => useWalletInner(def.name)).filter(w => w)
const { data: bestWalletList } = useQuery(BEST_WALLETS, SSR
? {}
: {
pollInterval: POLL_INTERVAL,
nextFetchPolicy: 'cache-and-network'
})
const { data: bestWalletList } = useQuery(BEST_WALLETS, {
pollInterval: POLL_INTERVAL,
nextFetchPolicy: 'cache-and-network',
skip: !me?.id
})
const processSendWallets = (bestWalletData) => {
const clientSideSorting = false // sorting is now done on the server