From 112a5b07ec52fab2a0ad377f4d0fa7c009a86af8 Mon Sep 17 00:00:00 2001 From: Kenny Tran Date: Fri, 26 Oct 2018 18:08:38 -0700 Subject: [PATCH] Fix approvals --- src/components/CurrencyInputPanel/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/CurrencyInputPanel/index.js b/src/components/CurrencyInputPanel/index.js index 423bb1d439..a742248392 100644 --- a/src/components/CurrencyInputPanel/index.js +++ b/src/components/CurrencyInputPanel/index.js @@ -219,7 +219,13 @@ class CurrencyInputPanel extends Component { const { value: allowance, decimals, label } = selectors().getApprovals(selectedTokenAddress, account, fromToken[selectedTokenAddress]); - if (!label || allowance.isGreaterThanOrEqualTo(BN(value * 10 ** decimals || 0))) { + if ( + !label || + ( + allowance.isGreaterThanOrEqualTo(BN((value || 0) * 10 ** decimals)) && + !BN(allowance).isZero() + ) + ) { return; }