diff --git a/packages/web/hooks/use-swap.tsx b/packages/web/hooks/use-swap.tsx index 2acf2ac1bb..40722020c5 100644 --- a/packages/web/hooks/use-swap.tsx +++ b/packages/web/hooks/use-swap.tsx @@ -801,19 +801,22 @@ function useSwapAmountInput({ Boolean(swapAssets.toAsset) ); + const networkQueryEnabled = + featureFlags.swapToolSimulateFee && + !isQuoteForCurrentBalanceLoading && + Boolean(quoteForCurrentBalance) && + !Boolean(account?.txTypeInProgress); const { data: currentBalanceNetworkFee, - isLoading: isLoadingCurrentBalanceNetworkFee, + isLoading: isLoadingCurrentBalanceNetworkFee_, error: currentBalanceNetworkFeeError, } = useEstimateTxFees({ chainId: chainStore.osmosis.chainId, messages: quoteForCurrentBalance?.messages, - enabled: - featureFlags.swapToolSimulateFee && - !isQuoteForCurrentBalanceLoading && - Boolean(quoteForCurrentBalance) && - !Boolean(account?.txTypeInProgress), + enabled: networkQueryEnabled, }); + const isLoadingCurrentBalanceNetworkFee = + networkQueryEnabled && isLoadingCurrentBalanceNetworkFee_; const hasErrorWithCurrentBalanceQuote = useMemo(() => { return !!currentBalanceNetworkFeeError || !!quoteForCurrentBalanceError;