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)
|
this.configManager.createShapeShiftTx(depositAddress, depositType)
|
||||||
}
|
}
|
||||||
|
|
||||||
setGasMultiplier (gasMultiplier) {
|
setGasMultiplier (gasMultiplier, cb) {
|
||||||
this.configManager.setGasMultiplier(gasMultiplier)
|
try{
|
||||||
|
this.configManager.setGasMultiplier(gasMultiplier)
|
||||||
|
cb()
|
||||||
|
} catch (e) {
|
||||||
|
cb(e)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -277,15 +277,17 @@ function signMsg (msgData) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function signTx (txData) {
|
function signTx (txData) {
|
||||||
_accountManager.setGasMultiplier(txData.gasMultiplier)
|
|
||||||
return (dispatch) => {
|
return (dispatch) => {
|
||||||
web3.eth.sendTransaction(txData, (err, data) => {
|
_accountManager.setGasMultiplier(txData.gasMultiplier, (err) => {
|
||||||
dispatch(actions.hideLoadingIndication())
|
|
||||||
if (err) return dispatch(actions.displayWarning(err.message))
|
if (err) return dispatch(actions.displayWarning(err.message))
|
||||||
dispatch(actions.hideWarning())
|
web3.eth.sendTransaction(txData, (err, data) => {
|
||||||
dispatch(actions.goHome())
|
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,
|
step: increment,
|
||||||
style: range,
|
style: range,
|
||||||
value: state.value || defaultValue,
|
value: state.value || defaultValue,
|
||||||
onChange: mirrorInput ? this.mirrorInputs.bind(this, name) : onInput,
|
onChange: mirrorInput ? this.mirrorInputs.bind(this, event) : onInput,
|
||||||
}),
|
}),
|
||||||
|
|
||||||
// Mirrored input for range
|
// Mirrored input for range
|
||||||
@ -47,12 +47,12 @@ RangeSlider.prototype.render = function () {
|
|||||||
value: state.value || defaultValue,
|
value: state.value || defaultValue,
|
||||||
step: increment,
|
step: increment,
|
||||||
style: input,
|
style: input,
|
||||||
onChange: this.mirrorInputs.bind(this, `${name}Mirror`),
|
onChange: this.mirrorInputs.bind(this, event),
|
||||||
}) : null,
|
}) : null,
|
||||||
])
|
])
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
RangeSlider.prototype.mirrorInputs = function (active, event) {
|
RangeSlider.prototype.mirrorInputs = function (event) {
|
||||||
this.setState({value: event.target.value})
|
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', {
|
h('h3.flex-center.text-transform-uppercase', {
|
||||||
style: {
|
style: {
|
||||||
background: '#EBEBEB',
|
background: '#EBEBEB',
|
||||||
|
Loading…
Reference in New Issue
Block a user