Skip to content

Commit

Permalink
fix wallet disconnected loading state
Browse files Browse the repository at this point in the history
  • Loading branch information
jonator committed May 31, 2024
1 parent 5eb316e commit eb1330b
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions packages/web/hooks/use-swap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit eb1330b

Please sign in to comment.