diff options
author | Dan Finlay <dan@danfinlay.com> | 2017-09-14 05:31:48 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2017-09-14 05:31:48 +0800 |
commit | 0ba649317592efced339980a729213876bc25a81 (patch) | |
tree | 8cfa7268b67b17196ebadaa55ed686cd91360780 | |
parent | 86cd4e4fedbea9639de33827733b4b85ef988bee (diff) | |
download | tangerine-wallet-browser-0ba649317592efced339980a729213876bc25a81.tar tangerine-wallet-browser-0ba649317592efced339980a729213876bc25a81.tar.gz tangerine-wallet-browser-0ba649317592efced339980a729213876bc25a81.tar.bz2 tangerine-wallet-browser-0ba649317592efced339980a729213876bc25a81.tar.lz tangerine-wallet-browser-0ba649317592efced339980a729213876bc25a81.tar.xz tangerine-wallet-browser-0ba649317592efced339980a729213876bc25a81.tar.zst tangerine-wallet-browser-0ba649317592efced339980a729213876bc25a81.zip |
Use computed balance for tx confirmation
-rw-r--r-- | ui/app/components/pending-tx.js | 6 | ||||
-rw-r--r-- | ui/app/conf-tx.js | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/ui/app/components/pending-tx.js b/ui/app/components/pending-tx.js index 3e53d47f9..1cc8daebe 100644 --- a/ui/app/components/pending-tx.js +++ b/ui/app/components/pending-tx.js @@ -33,7 +33,7 @@ function PendingTx () { PendingTx.prototype.render = function () { const props = this.props - const { currentCurrency, blockGasLimit } = props + const { currentCurrency, blockGasLimit, computedBalances } = props const conversionRate = props.conversionRate const txMeta = this.gatherTxMeta() @@ -42,8 +42,8 @@ PendingTx.prototype.render = function () { // Account Details const address = txParams.from || props.selectedAddress const identity = props.identities[address] || { address: address } - const account = props.accounts[address] - const balance = account ? account.balance : '0x0' + const account = computedBalances[address] + const balance = account ? account.ethBalance : '0x0' // recipient check const isValidAddress = !txParams.to || util.isValidAddress(txParams.to) diff --git a/ui/app/conf-tx.js b/ui/app/conf-tx.js index 1ee4166f7..8b93305eb 100644 --- a/ui/app/conf-tx.js +++ b/ui/app/conf-tx.js @@ -29,6 +29,7 @@ function mapStateToProps (state) { conversionRate: state.metamask.conversionRate, currentCurrency: state.metamask.currentCurrency, blockGasLimit: state.metamask.currentBlockGasLimit, + computedBalances: state.metamask.computedBalances, } } @@ -39,7 +40,7 @@ function ConfirmTxScreen () { ConfirmTxScreen.prototype.render = function () { const props = this.props - const { network, provider, unapprovedTxs, currentCurrency, + const { network, provider, unapprovedTxs, currentCurrency, computedBalances, unapprovedMsgs, unapprovedPersonalMsgs, conversionRate, blockGasLimit } = props var unconfTxList = txHelper(unapprovedTxs, unapprovedMsgs, unapprovedPersonalMsgs, network) @@ -104,6 +105,7 @@ ConfirmTxScreen.prototype.render = function () { currentCurrency, blockGasLimit, unconfTxListLength, + computedBalances, // Actions buyEth: this.buyEth.bind(this, txParams.from || props.selectedAddress), sendTransaction: this.sendTransaction.bind(this), |