From 9bb45e8e9acf3aa19c55082b9bd407843066e122 Mon Sep 17 00:00:00 2001 From: Nenad Vracar <34926005+nenadV91@users.noreply.github.com> Date: Thu, 5 May 2022 14:08:43 +0200 Subject: [PATCH] Fix for incorrect msg in swap (#524) * Fix for incorrect msg in swap * Updated the condition logic --- src/custom/state/swap/hooks.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/custom/state/swap/hooks.tsx b/src/custom/state/swap/hooks.tsx index 2b5a70144f..d240e75209 100644 --- a/src/custom/state/swap/hooks.tsx +++ b/src/custom/state/swap/hooks.tsx @@ -335,7 +335,7 @@ export function useDerivedSwapInfo(): /* { const [balanceIn, amountIn] = [currencyBalances[Field.INPUT], v2Trade?.maximumAmountIn(allowedSlippage)] // mod // Balance not loaded - fix for https://github.com/cowprotocol/cowswap/issues/451 - if (!balanceIn) { + if (!balanceIn && inputCurrency) { inputError = Couldn't load balances } @@ -344,7 +344,7 @@ export function useDerivedSwapInfo(): /* { } return inputError - }, [account, allowedSlippage, currencies, currencyBalances, parsedAmount, to, v2Trade]) // mod + }, [account, allowedSlippage, currencies, currencyBalances, inputCurrency, parsedAmount, to, v2Trade]) // mod return useMemo( () => ({