diff options
author | frankiebee <frankie.diamond@gmail.com> | 2018-04-30 07:00:13 +0800 |
---|---|---|
committer | frankiebee <frankie.diamond@gmail.com> | 2018-04-30 07:32:16 +0800 |
commit | 7eb735651bcd1c3a4ef2b4da1be5d7444e282b44 (patch) | |
tree | 186eee6d8da45d03a139c6344829aeef5a91110b /app/scripts/controllers/transactions/tx-state-manager.js | |
parent | 873f85d9962ff569baa8a5bbf2c1337c3b920419 (diff) | |
download | tangerine-wallet-browser-7eb735651bcd1c3a4ef2b4da1be5d7444e282b44.tar tangerine-wallet-browser-7eb735651bcd1c3a4ef2b4da1be5d7444e282b44.tar.gz tangerine-wallet-browser-7eb735651bcd1c3a4ef2b4da1be5d7444e282b44.tar.bz2 tangerine-wallet-browser-7eb735651bcd1c3a4ef2b4da1be5d7444e282b44.tar.lz tangerine-wallet-browser-7eb735651bcd1c3a4ef2b4da1be5d7444e282b44.tar.xz tangerine-wallet-browser-7eb735651bcd1c3a4ef2b4da1be5d7444e282b44.tar.zst tangerine-wallet-browser-7eb735651bcd1c3a4ef2b4da1be5d7444e282b44.zip |
transactions - run event emitters outside context of _setTxStatus
Diffstat (limited to 'app/scripts/controllers/transactions/tx-state-manager.js')
-rw-r--r-- | app/scripts/controllers/transactions/tx-state-manager.js | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/app/scripts/controllers/transactions/tx-state-manager.js b/app/scripts/controllers/transactions/tx-state-manager.js index 53428c333..17938e70f 100644 --- a/app/scripts/controllers/transactions/tx-state-manager.js +++ b/app/scripts/controllers/transactions/tx-state-manager.js @@ -398,13 +398,15 @@ class TransactionStateManager extends EventEmitter { _setTxStatus (txId, status) { const txMeta = this.getTx(txId) txMeta.status = 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.updateTx(txMeta, `txStateManager: setting status to ${status}`) - this.emit('update:badge') + 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) + } + this.emit('update:badge') + }) } /** |