diff options
author | Dan <danjm.com@gmail.com> | 2018-03-15 05:20:18 +0800 |
---|---|---|
committer | Dan <danjm.com@gmail.com> | 2018-03-15 08:59:43 +0800 |
commit | 66422cd083e86582b44d19664e6c6fc95bdb8ce5 (patch) | |
tree | c3f76c169abb295e6070ec0d3f7687f8d1f1ab04 /ui/app/components/customize-gas-modal/index.js | |
parent | a4c6a5e92e09b70db2e9ab92a8123176de127910 (diff) | |
download | tangerine-wallet-browser-66422cd083e86582b44d19664e6c6fc95bdb8ce5.tar.gz tangerine-wallet-browser-66422cd083e86582b44d19664e6c6fc95bdb8ce5.tar.zst tangerine-wallet-browser-66422cd083e86582b44d19664e6c6fc95bdb8ce5.zip |
Force gas min has correct precision and is set when editing gas if max.
Diffstat (limited to 'ui/app/components/customize-gas-modal/index.js')
-rw-r--r-- | ui/app/components/customize-gas-modal/index.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ui/app/components/customize-gas-modal/index.js b/ui/app/components/customize-gas-modal/index.js index 291447bb4..d8384c19d 100644 --- a/ui/app/components/customize-gas-modal/index.js +++ b/ui/app/components/customize-gas-modal/index.js @@ -233,6 +233,7 @@ CustomizeGasModal.prototype.render = function () { convertedGasPrice += convertedGasPrice.match(/[.]/) ? priceSigZeros : `${priceSigDec}${priceSigZeros}` + let newGasPrice = gasPrice if (forceGasMin) { const convertedMinPrice = conversionUtil(forceGasMin, { fromNumericBase: 'hex', @@ -242,6 +243,10 @@ CustomizeGasModal.prototype.render = function () { { value: convertedMinPrice, fromNumericBase: 'dec' }, { value: convertedGasPrice, fromNumericBase: 'dec' } ) + newGasPrice = conversionMax( + { value: gasPrice, fromNumericBase: 'hex' }, + { value: forceGasMin, fromNumericBase: 'hex' } + ) } const convertedGasLimit = conversionUtil(gasLimit, { @@ -302,7 +307,7 @@ CustomizeGasModal.prototype.render = function () { }, [t('cancel')]), h(`div.send-v2__customize-gas__save${error ? '__error' : ''}.allcaps`, { - onClick: () => !error && this.save(gasPrice, gasLimit, gasTotal), + onClick: () => !error && this.save(newGasPrice, gasLimit, gasTotal), }, [t('save')]), ]), |