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. 7
      ui/app/actions.js

@ -1,9 +1,10 @@
const promiseToCallback = require('promise-to-callback') const promiseToCallback = require('promise-to-callback')
module.exports = function(fn, context) { module.exports = function nodeify (fn, context) {
return function(){ return function(){
const args = [].slice.call(arguments) const args = [].slice.call(arguments)
const callback = args.pop() const callback = args.pop()
if (typeof callback !== 'function') throw new Error('callback is not a function')
promiseToCallback(fn.apply(context, args))(callback) promiseToCallback(fn.apply(context, args))(callback)
} }
} }

@ -462,9 +462,12 @@ function cancelPersonalMsg (msgData) {
} }
function cancelTx (txData) { function cancelTx (txData) {
return (dispatch) => {
log.debug(`background.cancelTransaction`) log.debug(`background.cancelTransaction`)
background.cancelTransaction(txData.id) background.cancelTransaction(txData.id, () => {
return actions.completedTx(txData.id) dispatch(actions.completedTx(txData.id))
})
}
} }
// //

Loading…
Cancel
Save