diff options
author | Alexander Tseung <alextsg@gmail.com> | 2018-07-07 02:58:41 +0800 |
---|---|---|
committer | Alexander Tseung <alextsg@gmail.com> | 2018-07-07 07:27:08 +0800 |
commit | a2d9c43fba49680d7553409a4f5013d3febd80e9 (patch) | |
tree | 56417ef3c675774173da49d3edfb951a3310fd5e /app/scripts/controllers | |
parent | 9cde5ab11b0670eed7baeb2f31486cb3e253bdcb (diff) | |
download | tangerine-wallet-browser-a2d9c43fba49680d7553409a4f5013d3febd80e9.tar tangerine-wallet-browser-a2d9c43fba49680d7553409a4f5013d3febd80e9.tar.gz tangerine-wallet-browser-a2d9c43fba49680d7553409a4f5013d3febd80e9.tar.bz2 tangerine-wallet-browser-a2d9c43fba49680d7553409a4f5013d3febd80e9.tar.lz tangerine-wallet-browser-a2d9c43fba49680d7553409a4f5013d3febd80e9.tar.xz tangerine-wallet-browser-a2d9c43fba49680d7553409a4f5013d3febd80e9.tar.zst tangerine-wallet-browser-a2d9c43fba49680d7553409a4f5013d3febd80e9.zip |
Various fixes from PR comments
Diffstat (limited to 'app/scripts/controllers')
-rw-r--r-- | app/scripts/controllers/transactions/tx-state-manager.js | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/app/scripts/controllers/transactions/tx-state-manager.js b/app/scripts/controllers/transactions/tx-state-manager.js index b4d751830..0aae4774b 100644 --- a/app/scripts/controllers/transactions/tx-state-manager.js +++ b/app/scripts/controllers/transactions/tx-state-manager.js @@ -399,17 +399,19 @@ class TransactionStateManager extends EventEmitter { _setTxStatus (txId, status) { const txMeta = this.getTx(txId) txMeta.status = status - 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) + setTimeout(() => { + 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') - } catch (error) { - log.error(error) - } + }) } /** |