aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/customize-gas-modal/index.js
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2017-10-18 01:22:23 +0800
committerChi Kei Chan <chikeichan@gmail.com>2017-10-19 11:21:46 +0800
commitf81226fbe9f98d5a6c408e289fa0ea61a467e7dc (patch)
treed2aba01747012ad1eb7829521647b71f88c114fe /ui/app/components/customize-gas-modal/index.js
parent4f9ac1c4fe67ec4c196ce1891ecc1743552d45ce (diff)
downloadtangerine-wallet-browser-f81226fbe9f98d5a6c408e289fa0ea61a467e7dc.tar.gz
tangerine-wallet-browser-f81226fbe9f98d5a6c408e289fa0ea61a467e7dc.tar.zst
tangerine-wallet-browser-f81226fbe9f98d5a6c408e289fa0ea61a467e7dc.zip
Move all of send state to metamask state.
Diffstat (limited to 'ui/app/components/customize-gas-modal/index.js')
-rw-r--r--ui/app/components/customize-gas-modal/index.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/ui/app/components/customize-gas-modal/index.js b/ui/app/components/customize-gas-modal/index.js
index 2df24b4e1..0ba768893 100644
--- a/ui/app/components/customize-gas-modal/index.js
+++ b/ui/app/components/customize-gas-modal/index.js
@@ -5,7 +5,7 @@ const connect = require('react-redux').connect
const actions = require('../../actions')
const GasModalCard = require('./gas-modal-card')
-const { conversionUtil } = require('../../conversion-util')
+const { conversionUtil, multiplyCurrencies } = require('../../conversion-util')
const {
getGasPrice,
@@ -26,6 +26,7 @@ function mapDispatchToProps (dispatch) {
hideModal: () => dispatch(actions.hideModal()),
updateGasPrice: newGasPrice => dispatch(actions.updateGasPrice(newGasPrice)),
updateGasLimit: newGasLimit => dispatch(actions.updateGasLimit(newGasLimit)),
+ updateGasTotal: newGasTotal => dispatch(actions.updateGasTotal(newGasTotal)),
}
}
@@ -46,10 +47,18 @@ CustomizeGasModal.prototype.save = function (gasPrice, gasLimit) {
updateGasPrice,
updateGasLimit,
hideModal,
+ updateGasTotal
} = this.props
+ const newGasTotal = multiplyCurrencies(gasLimit, gasPrice, {
+ toNumericBase: 'hex',
+ multiplicandBase: 16,
+ multiplierBase: 16,
+ })
+
updateGasPrice(gasPrice)
updateGasLimit(gasLimit)
+ updateGasTotal(newGasTotal)
hideModal()
}