aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/metamask-controller.js
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2017-01-14 07:51:08 +0800
committerkumavis <aaron@kumavis.me>2017-01-14 07:51:08 +0800
commitd755b66e204277ac6a904ba432f7b10a340c9288 (patch)
tree9efd4b35ea775a94ba8bd92680fd42117f5fbb29 /app/scripts/metamask-controller.js
parent29e83d71a82bfdbeadc9fbecfa97d73ef11fecfb (diff)
downloadtangerine-wallet-browser-d755b66e204277ac6a904ba432f7b10a340c9288.tar
tangerine-wallet-browser-d755b66e204277ac6a904ba432f7b10a340c9288.tar.gz
tangerine-wallet-browser-d755b66e204277ac6a904ba432f7b10a340c9288.tar.bz2
tangerine-wallet-browser-d755b66e204277ac6a904ba432f7b10a340c9288.tar.lz
tangerine-wallet-browser-d755b66e204277ac6a904ba432f7b10a340c9288.tar.xz
tangerine-wallet-browser-d755b66e204277ac6a904ba432f7b10a340c9288.tar.zst
tangerine-wallet-browser-d755b66e204277ac6a904ba432f7b10a340c9288.zip
background - metamask controller - fix 'this' ref
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)
}
})
}