diff options
author | Dan <danjm.com@gmail.com> | 2017-11-09 23:14:32 +0800 |
---|---|---|
committer | Chi Kei Chan <chikeichan@gmail.com> | 2017-11-15 08:18:00 +0800 |
commit | 4671f28476165fec43785ae23352c1e9a0776abc (patch) | |
tree | 58b6f4a1b46d70f279ed2120d23cc0acbcf04372 /ui/app/send-v2.js | |
parent | 0a91671ff69957596abbcffb7d20c89f144d7a69 (diff) | |
download | tangerine-wallet-browser-4671f28476165fec43785ae23352c1e9a0776abc.tar.gz tangerine-wallet-browser-4671f28476165fec43785ae23352c1e9a0776abc.tar.zst tangerine-wallet-browser-4671f28476165fec43785ae23352c1e9a0776abc.zip |
Allow editing of token transactions.
Diffstat (limited to 'ui/app/send-v2.js')
-rw-r--r-- | ui/app/send-v2.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ui/app/send-v2.js b/ui/app/send-v2.js index 0d745c66e..788ae87b4 100644 --- a/ui/app/send-v2.js +++ b/ui/app/send-v2.js @@ -76,7 +76,6 @@ SendTransactionScreen.prototype.updateSendTokenBalance = function (usersToken) { updateSendTokenBalance, } = this.props const { decimals } = selectedToken || {} - const tokenBalance = calcTokenAmount(usersToken.balance.toString(), decimals) updateSendTokenBalance(tokenBalance) @@ -105,13 +104,14 @@ SendTransactionScreen.prototype.componentWillMount = function () { const estimateGasParams = getParamsForGasEstimate(selectedAddress, symbol, data) + const tokenBalancePromise = tokenContract && tokenContract.balanceOf(from.address) let newGasTotal if (!editingTransactionId) { Promise .all([ getGasPrice(), estimateGas(estimateGasParams), - tokenContract && tokenContract.balanceOf(from.address), + tokenBalancePromise, ]) .then(([gasPrice, gas, usersToken]) => { @@ -130,6 +130,8 @@ SendTransactionScreen.prototype.componentWillMount = function () { multiplierBase: 16, }) updateGasTotal(newGasTotal) + tokenBalancePromise && tokenBalancePromise.then( + usersToken => this.updateSendTokenBalance(usersToken)) } } @@ -363,7 +365,6 @@ SendTransactionScreen.prototype.validateAmount = function (value) { const amount = value let amountError = null - const sufficientBalance = isBalanceSufficient({ amount: selectedToken ? '0x0' : amount, gasTotal, |