Skip to content

Commit

Permalink
Various fixes from PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
alextsg committed Jul 6, 2018
1 parent 9cde5ab commit a2d9c43
Show file tree
Hide file tree
Showing 16 changed files with 614 additions and 23,794 deletions.
22 changes: 12 additions & 10 deletions app/scripts/controllers/transactions/tx-state-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
})
}

/**
Expand Down
Loading

0 comments on commit a2d9c43

Please sign in to comment.