aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/metamask-controller.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/scripts/metamask-controller.js')
-rw-r--r--app/scripts/metamask-controller.js15
1 files changed, 8 insertions, 7 deletions
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js
index 67c35dd67..315b9832c 100644
--- a/app/scripts/metamask-controller.js
+++ b/app/scripts/metamask-controller.js
@@ -239,13 +239,14 @@ module.exports = class MetamaskController extends EventEmitter {
}
newUnapprovedTransaction (txParams, cb) {
- this.txManager.addUnapprovedTransaction(txParams, (err, txMeta) => {
+ const self = this
+ self.txManager.addUnapprovedTransaction(txParams, (err, txMeta) => {
if (err) return cb(err)
- this.sendUpdate()
- this.opts.showUnapprovedTx(txMeta)
+ self.sendUpdate()
+ self.opts.showUnapprovedTx(txMeta)
// listen for tx completion (success, fail)
- this.txManager.once(`${txMeta.id}:submitted`, successHandler)
- this.txManager.once(`${txMeta.id}:rejected`, failHandler)
+ self.txManager.once(`${txMeta.id}:submitted`, successHandler)
+ self.txManager.once(`${txMeta.id}:rejected`, failHandler)
function successHandler(rawTx) {
removeHandlers()
cb(null, rawTx)
@@ -255,8 +256,8 @@ module.exports = class MetamaskController extends EventEmitter {
cb(new Error('User denied message signature.'))
}
function removeHandlers() {
- this.txManager.removeListener(`${txMeta.id}:submitted`, successHandler)
- this.txManager.removeListener(`${txMeta.id}:rejected`, failHandler)
+ self.txManager.removeListener(`${txMeta.id}:submitted`, successHandler)
+ self.txManager.removeListener(`${txMeta.id}:rejected`, failHandler)
}
})
}