diff --git a/src/state/sync/UserAssetsSync.tsx b/src/state/sync/UserAssetsSync.tsx index b5368fa1cb0..697c01f68fd 100644 --- a/src/state/sync/UserAssetsSync.tsx +++ b/src/state/sync/UserAssetsSync.tsx @@ -9,6 +9,8 @@ import { ChainId } from '@/chains/types'; export const UserAssetsSync = function UserAssetsSync() { const { accountAddress, nativeCurrency: currentCurrency } = useAccountSettings(); const isSwapsOpen = useSwapsStore(state => state.isSwapsOpen); + const isUserAssetsStoreMissingData = userAssetsStore.getState().getUserAssets()?.length === 0; + const enabled = (!isSwapsOpen || isUserAssetsStoreMissingData) && !!accountAddress && !!currentCurrency; useUserAssets( { @@ -16,13 +18,13 @@ export const UserAssetsSync = function UserAssetsSync() { currency: currentCurrency, }, { + enabled, select: data => selectorFilterByUserChains({ data, selector: selectUserAssetsList, }), onSuccess: data => { - const isUserAssetsStoreMissingData = userAssetsStore.getState().getUserAssets()?.length === 0; if (!isSwapsOpen || isUserAssetsStoreMissingData) { userAssetsStore.getState().setUserAssets(data as ParsedSearchAsset[]);