diff --git a/src/__swaps__/screens/Swap/components/TokenList/ChainSelection.tsx b/src/__swaps__/screens/Swap/components/TokenList/ChainSelection.tsx index 6e803ae4904..9bd8f61b63c 100644 --- a/src/__swaps__/screens/Swap/components/TokenList/ChainSelection.tsx +++ b/src/__swaps__/screens/Swap/components/TokenList/ChainSelection.tsx @@ -32,10 +32,9 @@ export const ChainSelection = memo(function ChainSelection({ allText, output }: const backendNetworks = useBackendNetworksStore(state => state.backendNetworksSharedValue); // chains sorted by balance on output, chains without balance hidden on input - const { balanceSortedChainList, filter } = useUserAssetsStore(state => ({ - balanceSortedChainList: output ? state.getBalanceSortedChainList() : state.getChainsWithBalance(), - filter: state.filter, - })); + const balanceSortedChainList = useUserAssetsStore(state => (output ? state.getBalanceSortedChainList() : state.getChainsWithBalance())); + const filter = useUserAssetsStore(state => state.filter); + const inputListFilter = useSharedValue(filter); const accentColor = useMemo(() => { diff --git a/src/__swaps__/screens/Swap/providers/SyncSwapStateAndSharedValues.tsx b/src/__swaps__/screens/Swap/providers/SyncSwapStateAndSharedValues.tsx index 715ff149768..2f75a805edb 100644 --- a/src/__swaps__/screens/Swap/providers/SyncSwapStateAndSharedValues.tsx +++ b/src/__swaps__/screens/Swap/providers/SyncSwapStateAndSharedValues.tsx @@ -146,11 +146,11 @@ export function SyncGasStateToSharedValues() { const gasSettings = useSelectedGas(chainId); - const { userNativeNetworkAsset, isLoadingNativeNetworkAsset } = useUserAssetsStore(state => { - const { address: nativeCurrencyAddress } = useBackendNetworksStore.getState().getChainsNativeAsset()[chainId]; - const uniqueId = getUniqueId(nativeCurrencyAddress, chainId); - return { userNativeNetworkAsset: state.getLegacyUserAsset(uniqueId), isLoadingNativeNetworkAsset: state.isLoadingUserAssets }; - }); + const { address: nativeCurrencyAddress } = useBackendNetworksStore.getState().getChainsNativeAsset()[chainId]; + + const isLoadingNativeNetworkAsset = useUserAssetsStore(state => state.isLoadingUserAssets); + const userNativeNetworkAsset = useUserAssetsStore(state => state.getLegacyUserAsset(getUniqueId(nativeCurrencyAddress, chainId))); + const { data: estimatedGasLimit } = useSwapEstimatedGasLimit({ chainId, assetToSell, quote }); const gasFeeRange = useSharedValue<[string, string] | null>(null); diff --git a/src/hooks/useWalletSectionsData.ts b/src/hooks/useWalletSectionsData.ts index 9013f7106c2..2f427a0df35 100644 --- a/src/hooks/useWalletSectionsData.ts +++ b/src/hooks/useWalletSectionsData.ts @@ -56,10 +56,8 @@ export default function useWalletSectionsData({ } = {}) { const { accountAddress, language, network, nativeCurrency } = useAccountSettings(); const { selectedWallet, isReadOnlyWallet } = useWallets(); - const { isLoadingUserAssets, sortedAssets = [] } = useUserAssetsStore(state => ({ - sortedAssets: state.legacyUserAssets, - isLoadingUserAssets: state.isLoadingUserAssets, - })); + const isLoadingUserAssets = useUserAssetsStore(state => state.isLoadingUserAssets); + const sortedAssets = useUserAssetsStore(state => state.legacyUserAssets); const isWalletEthZero = useIsWalletEthZero(); const { nftSort, nftSortDirection } = useNftSort(); diff --git a/src/hooks/useWatchPendingTxs.ts b/src/hooks/useWatchPendingTxs.ts index 4c90fcfa16c..1341563e335 100644 --- a/src/hooks/useWatchPendingTxs.ts +++ b/src/hooks/useWatchPendingTxs.ts @@ -14,10 +14,9 @@ import { useConnectedToAnvilStore } from '@/state/connectedToAnvil'; import { useBackendNetworksStore } from '@/state/backendNetworks/backendNetworks'; export const useWatchPendingTransactions = ({ address }: { address: string }) => { - const { storePendingTransactions, setPendingTransactions } = usePendingTransactionsStore(state => ({ - storePendingTransactions: state.pendingTransactions, - setPendingTransactions: state.setPendingTransactions, - })); + const storePendingTransactions = usePendingTransactionsStore(state => state.pendingTransactions); + const setPendingTransactions = usePendingTransactionsStore(state => state.setPendingTransactions); + const { connectedToAnvil } = useConnectedToAnvilStore(); const pendingTransactions = useMemo(() => storePendingTransactions[address] || [], [address, storePendingTransactions]);