diff options
author | Dan <danjm.com@gmail.com> | 2017-09-27 09:33:03 +0800 |
---|---|---|
committer | Chi Kei Chan <chikeichan@gmail.com> | 2017-09-27 09:43:26 +0800 |
commit | 39365f2cc419ee824988e6dad4e8a75e650ad1cc (patch) | |
tree | bca98bc3776e91f54c08c47ae117be2bcb080b50 /ui/app/send.js | |
parent | 541b69dda9a5ddbb0ea4e4c0df805e886f53645c (diff) | |
download | tangerine-wallet-browser-39365f2cc419ee824988e6dad4e8a75e650ad1cc.tar tangerine-wallet-browser-39365f2cc419ee824988e6dad4e8a75e650ad1cc.tar.gz tangerine-wallet-browser-39365f2cc419ee824988e6dad4e8a75e650ad1cc.tar.bz2 tangerine-wallet-browser-39365f2cc419ee824988e6dad4e8a75e650ad1cc.tar.lz tangerine-wallet-browser-39365f2cc419ee824988e6dad4e8a75e650ad1cc.tar.xz tangerine-wallet-browser-39365f2cc419ee824988e6dad4e8a75e650ad1cc.tar.zst tangerine-wallet-browser-39365f2cc419ee824988e6dad4e8a75e650ad1cc.zip |
Update the correct values in state when estimates are received.
Diffstat (limited to 'ui/app/send.js')
-rw-r--r-- | ui/app/send.js | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/ui/app/send.js b/ui/app/send.js index dc7e7c8ec..4d2a5f48d 100644 --- a/ui/app/send.js +++ b/ui/app/send.js @@ -35,8 +35,6 @@ function mapStateToProps (state) { addressBook, conversionRate, currentBlockGasLimit: blockGasLimit, - estimatedGas, - blockGasPrice, } = state.metamask const { warning } = state.appState const selectedIdentity = getSelectedIdentity(state) @@ -76,8 +74,6 @@ function SendTransactionScreen () { txData: null, memo: '', }, - blockGasPrice: null, - estimatedGas: null, activeCurrency: 'USD', tooltipIsOpen: false, errors: {}, @@ -103,14 +99,19 @@ function SendTransactionScreen () { } SendTransactionScreen.prototype.componentWillMount = function () { + const { newTx } = this.state + Promise.all([ this.props.dispatch(getGasPrice()), this.props.dispatch(estimateGas()), ]) .then(([blockGasPrice, estimatedGas]) => { this.setState({ - blockGasPrice, - estimatedGas, + newTx: { + ...newTx, + gasPrice: blockGasPrice, + gas: estimatedGas, + }, }) }) } @@ -329,8 +330,6 @@ SendTransactionScreen.prototype.render = function () { newTx, activeCurrency, isValid, - blockGasPrice, - estimatedGas, } = this.state const { gas, gasPrice } = newTx @@ -353,8 +352,8 @@ SendTransactionScreen.prototype.render = function () { this.renderAmountInput(activeCurrency), this.renderGasInput( - gasPrice || blockGasPrice || '0x0', - gas || estimatedGas || '0x0', + gasPrice || '0x0', + gas || '0x0', activeCurrency, conversionRate, blockGasLimit |