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:
parent
328f8b0cac
commit
aace26c4bd
@ -379,7 +379,12 @@ module.exports = class MetamaskController {
|
||||
this.configManager.createShapeShiftTx(depositAddress, depositType)
|
||||
}
|
||||
|
||||
setGasMultiplier (gasMultiplier) {
|
||||
this.configManager.setGasMultiplier(gasMultiplier)
|
||||
setGasMultiplier (gasMultiplier, cb) {
|
||||
try{
|
||||
this.configManager.setGasMultiplier(gasMultiplier)
|
||||
cb()
|
||||
} catch (e) {
|
||||
cb(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -277,15 +277,17 @@ function signMsg (msgData) {
|
||||
}
|
||||
|
||||
function signTx (txData) {
|
||||
_accountManager.setGasMultiplier(txData.gasMultiplier)
|
||||
return (dispatch) => {
|
||||
web3.eth.sendTransaction(txData, (err, data) => {
|
||||
dispatch(actions.hideLoadingIndication())
|
||||
_accountManager.setGasMultiplier(txData.gasMultiplier, (err) => {
|
||||
if (err) return dispatch(actions.displayWarning(err.message))
|
||||
dispatch(actions.hideWarning())
|
||||
dispatch(actions.goHome())
|
||||
web3.eth.sendTransaction(txData, (err, data) => {
|
||||
dispatch(actions.hideLoadingIndication())
|
||||
if (err) return dispatch(actions.displayWarning(err.message))
|
||||
dispatch(actions.hideWarning())
|
||||
dispatch(actions.goHome())
|
||||
})
|
||||
dispatch(this.showConfTxPage())
|
||||
})
|
||||
dispatch(this.showConfTxPage())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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})
|
||||
}
|
||||
|
@ -207,7 +207,7 @@ SendTransactionScreen.prototype.render = function () {
|
||||
},
|
||||
}),
|
||||
]),
|
||||
// custom gas field
|
||||
// custom gasPrice field
|
||||
h('h3.flex-center.text-transform-uppercase', {
|
||||
style: {
|
||||
background: '#EBEBEB',
|
||||
|
Loading…
Reference in New Issue
Block a user