diff --git a/packages/web/src/hooks/swap/data/use-swap-handler.tsx b/packages/web/src/hooks/swap/data/use-swap-handler.tsx index 2848e2890..e47a6af0c 100644 --- a/packages/web/src/hooks/swap/data/use-swap-handler.tsx +++ b/packages/web/src/hooks/swap/data/use-swap-handler.tsx @@ -178,6 +178,7 @@ export const useSwapHandler = () => { updateSwapAmount, resetSwapAmount, isTyping, + isRefetching, handleResetEstimatedLiquidity, } = useSwap({ tokenA, @@ -1131,6 +1132,7 @@ export const useSwapHandler = () => { isSwitchNetwork, switchNetwork, isLoading: swapState === "LOADING" || isTyping, + isRefetching, setSwapValue, tokenA, tokenB, diff --git a/packages/web/src/hooks/swap/data/use-swap.tsx b/packages/web/src/hooks/swap/data/use-swap.tsx index 32e75d723..51be98646 100644 --- a/packages/web/src/hooks/swap/data/use-swap.tsx +++ b/packages/web/src/hooks/swap/data/use-swap.tsx @@ -81,6 +81,7 @@ export const useSwap = ({ tokenA, tokenB, direction, slippage, swapFee = 15 }: U const { data: estimatedSwapResult, isLoading: isEstimatedSwapLoading, + isRefetching, error, } = useGetRoutes( { @@ -309,6 +310,7 @@ export const useSwap = ({ tokenA, tokenB, direction, slippage, swapFee = 15 }: U updateSwapAmount, isEstimatedSwapLoading, isTyping, + isRefetching, handleResetEstimatedLiquidity, resetSwapAmount: () => { setSwapAmount(0); diff --git a/packages/web/src/layouts/swap/components/swap-card/SwapCard.tsx b/packages/web/src/layouts/swap/components/swap-card/SwapCard.tsx index 32b6c36e1..5a2339b0e 100644 --- a/packages/web/src/layouts/swap/components/swap-card/SwapCard.tsx +++ b/packages/web/src/layouts/swap/components/swap-card/SwapCard.tsx @@ -32,6 +32,7 @@ interface SwapCardProps { isSwitchNetwork: boolean; isLoading: boolean; isSameToken: boolean; + isRefetching: boolean; changeTokenA: (token: TokenModel) => void; changeTokenAAmount: (value: string, none?: boolean) => void; @@ -76,6 +77,7 @@ const SwapCard: React.FC = ({ setSwapRateAction, priceImpactStatus, isSameToken, + isRefetching, }) => { const theme = useTheme(); const { t } = useTranslation(); @@ -109,6 +111,7 @@ const SwapCard: React.FC = ({ isSwitchNetwork={isSwitchNetwork} priceImpactStatus={priceImpactStatus} isSameToken={isSameToken} + isRefetching={isRefetching} resetEstimatedLiquidity={resetEstimatedLiquidity} /> {shouldShowPriceImpactWarning && ( diff --git a/packages/web/src/layouts/swap/components/swap-card/swap-card-content/SwapCardContent.tsx b/packages/web/src/layouts/swap/components/swap-card/swap-card-content/SwapCardContent.tsx index 48fc48ac3..d02741365 100644 --- a/packages/web/src/layouts/swap/components/swap-card/swap-card-content/SwapCardContent.tsx +++ b/packages/web/src/layouts/swap/components/swap-card/swap-card-content/SwapCardContent.tsx @@ -38,6 +38,7 @@ interface ContentProps { isSwitchNetwork: boolean; priceImpactStatus: PriceImpactStatus; isSameToken: boolean; + isRefetching: boolean; } const SwapCardContent: React.FC = ({ @@ -55,6 +56,7 @@ const SwapCardContent: React.FC = ({ priceImpactStatus, isSameToken, resetEstimatedLiquidity, + isRefetching, }) => { const { t } = useTranslation(); @@ -134,7 +136,11 @@ const SwapCardContent: React.FC = ({
= ({
{ isSwitchNetwork, switchNetwork, isLoading, + isRefetching, setSwapValue, setSwapRateAction, priceImpactStatus, @@ -121,6 +122,7 @@ const SwapContainer: React.FC = () => { priceImpactStatus={priceImpactStatus} resetEstimatedLiquidity={handleResetEstimatedLiquidity} isSameToken={isSameToken} + isRefetching={isRefetching} /> ); };