mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-26 20:39:08 +01:00
fix cancelTransaction not reciving a callback
This commit is contained in:
parent
8a9d0073b1
commit
7de58c8709
@ -1,9 +1,10 @@
|
||||
const promiseToCallback = require('promise-to-callback')
|
||||
|
||||
module.exports = function(fn, context) {
|
||||
module.exports = function nodeify (fn, context) {
|
||||
return function(){
|
||||
const args = [].slice.call(arguments)
|
||||
const callback = args.pop()
|
||||
if (typeof callback !== 'function') throw new Error('callback is not a function')
|
||||
promiseToCallback(fn.apply(context, args))(callback)
|
||||
}
|
||||
}
|
||||
|
@ -462,9 +462,12 @@ function cancelPersonalMsg (msgData) {
|
||||
}
|
||||
|
||||
function cancelTx (txData) {
|
||||
log.debug(`background.cancelTransaction`)
|
||||
background.cancelTransaction(txData.id)
|
||||
return actions.completedTx(txData.id)
|
||||
return (dispatch) => {
|
||||
log.debug(`background.cancelTransaction`)
|
||||
background.cancelTransaction(txData.id, () => {
|
||||
dispatch(actions.completedTx(txData.id))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
|
Loading…
Reference in New Issue
Block a user