Skip to content

Commit

Permalink
Fix for incorrect msg in swap (#524)
Browse files Browse the repository at this point in the history
* Fix for incorrect msg in swap

* Updated the condition logic
  • Loading branch information
nenadV91 authored May 5, 2022
1 parent f64eb59 commit 9bb45e8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/custom/state/swap/hooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = <Trans>Couldn&apos;t load balances</Trans>
}

Expand All @@ -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(
() => ({
Expand Down

0 comments on commit 9bb45e8

Please sign in to comment.