diff options
author | Alexander Tseung <alextsg@gmail.com> | 2018-06-23 14:52:45 +0800 |
---|---|---|
committer | Alexander Tseung <alextsg@gmail.com> | 2018-07-07 07:27:08 +0800 |
commit | ea9d51e427b8e607e612a01629bebf153e516ad9 (patch) | |
tree | 6363cd72b7517442c718901cc8b8ed023d134081 /app/scripts/controllers | |
parent | b4aaf30d6fe829f18dea68a5e6cc321b9fb00d4e (diff) | |
download | tangerine-wallet-browser-ea9d51e427b8e607e612a01629bebf153e516ad9.tar tangerine-wallet-browser-ea9d51e427b8e607e612a01629bebf153e516ad9.tar.gz tangerine-wallet-browser-ea9d51e427b8e607e612a01629bebf153e516ad9.tar.bz2 tangerine-wallet-browser-ea9d51e427b8e607e612a01629bebf153e516ad9.tar.lz tangerine-wallet-browser-ea9d51e427b8e607e612a01629bebf153e516ad9.tar.xz tangerine-wallet-browser-ea9d51e427b8e607e612a01629bebf153e516ad9.tar.zst tangerine-wallet-browser-ea9d51e427b8e607e612a01629bebf153e516ad9.zip |
Refactor and redesign confirm transaction views
Diffstat (limited to 'app/scripts/controllers')
-rw-r--r-- | app/scripts/controllers/network/enums.js | 3 | ||||
-rw-r--r-- | app/scripts/controllers/transactions/tx-state-manager.js | 22 |
2 files changed, 12 insertions, 13 deletions
diff --git a/app/scripts/controllers/network/enums.js b/app/scripts/controllers/network/enums.js index 9da7f309c..3190eb37c 100644 --- a/app/scripts/controllers/network/enums.js +++ b/app/scripts/controllers/network/enums.js @@ -4,6 +4,7 @@ const KOVAN = 'kovan' const MAINNET = 'mainnet' const LOCALHOST = 'localhost' +const MAINNET_CODE = 1 const ROPSTEN_CODE = 3 const RINKEYBY_CODE = 4 const KOVAN_CODE = 42 @@ -13,13 +14,13 @@ const RINKEBY_DISPLAY_NAME = 'Rinkeby' const KOVAN_DISPLAY_NAME = 'Kovan' const MAINNET_DISPLAY_NAME = 'Main Ethereum Network' - module.exports = { ROPSTEN, RINKEBY, KOVAN, MAINNET, LOCALHOST, + MAINNET_CODE, ROPSTEN_CODE, RINKEYBY_CODE, KOVAN_CODE, diff --git a/app/scripts/controllers/transactions/tx-state-manager.js b/app/scripts/controllers/transactions/tx-state-manager.js index 0aae4774b..b4d751830 100644 --- a/app/scripts/controllers/transactions/tx-state-manager.js +++ b/app/scripts/controllers/transactions/tx-state-manager.js @@ -399,19 +399,17 @@ class TransactionStateManager extends EventEmitter { _setTxStatus (txId, status) { const txMeta = this.getTx(txId) txMeta.status = status - 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) + 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) + } } /** |