diff options
author | frankiebee <frankie.diamond@gmail.com> | 2018-04-30 07:33:46 +0800 |
---|---|---|
committer | frankiebee <frankie.diamond@gmail.com> | 2018-04-30 07:35:08 +0800 |
commit | 706647785cee23d177d646c3a06f5dc2a2586feb (patch) | |
tree | e74efca4387693831ec56ff00354549965763a90 /app/scripts/controllers/transactions | |
parent | 7eb735651bcd1c3a4ef2b4da1be5d7444e282b44 (diff) | |
download | tangerine-wallet-browser-706647785cee23d177d646c3a06f5dc2a2586feb.tar tangerine-wallet-browser-706647785cee23d177d646c3a06f5dc2a2586feb.tar.gz tangerine-wallet-browser-706647785cee23d177d646c3a06f5dc2a2586feb.tar.bz2 tangerine-wallet-browser-706647785cee23d177d646c3a06f5dc2a2586feb.tar.lz tangerine-wallet-browser-706647785cee23d177d646c3a06f5dc2a2586feb.tar.xz tangerine-wallet-browser-706647785cee23d177d646c3a06f5dc2a2586feb.tar.zst tangerine-wallet-browser-706647785cee23d177d646c3a06f5dc2a2586feb.zip |
log emitter errors
Diffstat (limited to 'app/scripts/controllers/transactions')
-rw-r--r-- | app/scripts/controllers/transactions/tx-state-manager.js | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/app/scripts/controllers/transactions/tx-state-manager.js b/app/scripts/controllers/transactions/tx-state-manager.js index 17938e70f..28b6d6d4f 100644 --- a/app/scripts/controllers/transactions/tx-state-manager.js +++ b/app/scripts/controllers/transactions/tx-state-manager.js @@ -399,13 +399,17 @@ class TransactionStateManager extends EventEmitter { const txMeta = this.getTx(txId) txMeta.status = status setTimeout(() => { - this.updateTx(txMeta, `txStateManager: setting status to ${status}`) - this.emit(`${txMeta.id}:${status}`, txId) - this.emit(`tx:status-update`, txId, status) - if (['submitted', 'rejected', 'failed'].includes(status)) { - this.emit(`${txMeta.id}:finished`, txMeta) + try { + this.updateTx(txMeta, `txStateManager: setting status to ${status}`) + this.emit(`${txMeta.id}:${status}`, txId) + this.emit(`tx:status-update`, txId, status) + if (['submitted', 'rejected', 'failed'].includes(status)) { + this.emit(`${txMeta.id}:finished`, txMeta) + } + this.emit('update:badge') + } catch (error) { + log.error(error) } - this.emit('update:badge') }) } |