diff options
author | Kevin Serrano <kevgagser@gmail.com> | 2017-03-02 06:37:51 +0800 |
---|---|---|
committer | Kevin Serrano <kevgagser@gmail.com> | 2017-03-02 06:37:51 +0800 |
commit | 0ac1f749fd68244682d0f2c763028cdf6aa29486 (patch) | |
tree | 1ce3ebac2f18f119dc12ad09b35bd1a8a6af9f38 /ui/app/components/pending-tx-details.js | |
parent | 5f378d382e008ef577223055c9674c25e2e6bba4 (diff) | |
download | tangerine-wallet-browser-0ac1f749fd68244682d0f2c763028cdf6aa29486.tar tangerine-wallet-browser-0ac1f749fd68244682d0f2c763028cdf6aa29486.tar.gz tangerine-wallet-browser-0ac1f749fd68244682d0f2c763028cdf6aa29486.tar.bz2 tangerine-wallet-browser-0ac1f749fd68244682d0f2c763028cdf6aa29486.tar.lz tangerine-wallet-browser-0ac1f749fd68244682d0f2c763028cdf6aa29486.tar.xz tangerine-wallet-browser-0ac1f749fd68244682d0f2c763028cdf6aa29486.tar.zst tangerine-wallet-browser-0ac1f749fd68244682d0f2c763028cdf6aa29486.zip |
Various improvements to gas input.
Diffstat (limited to 'ui/app/components/pending-tx-details.js')
-rw-r--r-- | ui/app/components/pending-tx-details.js | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/ui/app/components/pending-tx-details.js b/ui/app/components/pending-tx-details.js index b1ab9576b..fc8d65454 100644 --- a/ui/app/components/pending-tx-details.js +++ b/ui/app/components/pending-tx-details.js @@ -32,10 +32,8 @@ PTXP.render = function () { var account = props.accounts[address] var balance = account ? account.balance : '0x0' - const gas = state.gas || txParams.gas - const gasPrice = state.gasPrice || txData.gasPrice - const gasDefault = txParams.gas - const gasPriceDefault = txData.gasPrice + const gas = (state.gas === undefined) ? txParams.gas : state.gas + const gasPrice = (state.gasPrice === undefined) ? txData.gasPrice : state.gasPrice var txFee = state.txFee || txData.txFee || '' var maxCost = state.maxCost || txData.maxCost || '' @@ -131,11 +129,7 @@ PTXP.render = function () { }, onChange: (newHex) => { log.info(`Gas limit changed to ${newHex}`) - if (newHex === '0x0') { - this.setState({gas: gasDefault}) - } else { - this.setState({ gas: newHex }) - } + this.setState({ gas: newHex }) }, }), ]), @@ -155,11 +149,7 @@ PTXP.render = function () { }, onChange: (newHex) => { log.info(`Gas price changed to: ${newHex}`) - if (newHex === '0x0') { - this.setState({gasPrice: gasPriceDefault}) - } else { - this.setState({ gasPrice: newHex }) - } + this.setState({ gasPrice: newHex }) }, }), ]), |