fix cancelTransaction not reciving a callback

feature/default_network_editable
frankiebee 7 years ago
parent 8a9d0073b1
commit 7de58c8709
  1. 3
      app/scripts/lib/nodeify.js
  2. 9
      ui/app/actions.js

@ -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…
Cancel
Save