1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 01:39:44 +01:00

Create callback and Clean-up details

This commit is contained in:
Frankie 2016-10-13 16:53:32 -07:00
parent 328f8b0cac
commit aace26c4bd
4 changed files with 19 additions and 12 deletions

View File

@ -379,7 +379,12 @@ module.exports = class MetamaskController {
this.configManager.createShapeShiftTx(depositAddress, depositType)
}
setGasMultiplier (gasMultiplier) {
setGasMultiplier (gasMultiplier, cb) {
try{
this.configManager.setGasMultiplier(gasMultiplier)
cb()
} catch (e) {
cb(e)
}
}
}

View File

@ -277,8 +277,9 @@ function signMsg (msgData) {
}
function signTx (txData) {
_accountManager.setGasMultiplier(txData.gasMultiplier)
return (dispatch) => {
_accountManager.setGasMultiplier(txData.gasMultiplier, (err) => {
if (err) return dispatch(actions.displayWarning(err.message))
web3.eth.sendTransaction(txData, (err, data) => {
dispatch(actions.hideLoadingIndication())
if (err) return dispatch(actions.displayWarning(err.message))
@ -286,6 +287,7 @@ function signTx (txData) {
dispatch(actions.goHome())
})
dispatch(this.showConfTxPage())
})
}
}

View File

@ -35,7 +35,7 @@ RangeSlider.prototype.render = function () {
step: increment,
style: range,
value: state.value || defaultValue,
onChange: mirrorInput ? this.mirrorInputs.bind(this, name) : onInput,
onChange: mirrorInput ? this.mirrorInputs.bind(this, event) : onInput,
}),
// Mirrored input for range
@ -47,12 +47,12 @@ RangeSlider.prototype.render = function () {
value: state.value || defaultValue,
step: increment,
style: input,
onChange: this.mirrorInputs.bind(this, `${name}Mirror`),
onChange: this.mirrorInputs.bind(this, event),
}) : null,
])
)
}
RangeSlider.prototype.mirrorInputs = function (active, event) {
RangeSlider.prototype.mirrorInputs = function (event) {
this.setState({value: event.target.value})
}

View File

@ -207,7 +207,7 @@ SendTransactionScreen.prototype.render = function () {
},
}),
]),
// custom gas field
// custom gasPrice field
h('h3.flex-center.text-transform-uppercase', {
style: {
background: '#EBEBEB',