diff options
author | Frankie <frankie.diamond@gmail.com> | 2018-12-14 03:14:46 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-14 03:14:46 +0800 |
commit | b5d6452454de8d12340e5902914fba9f420865dc (patch) | |
tree | 34b68e4e54e2140e52e542cd9ae6a790fb45ca5d /app | |
parent | c5861c88a5e8ca98e52a7acc13479dbba0341eb1 (diff) | |
download | tangerine-wallet-browser-b5d6452454de8d12340e5902914fba9f420865dc.tar tangerine-wallet-browser-b5d6452454de8d12340e5902914fba9f420865dc.tar.gz tangerine-wallet-browser-b5d6452454de8d12340e5902914fba9f420865dc.tar.bz2 tangerine-wallet-browser-b5d6452454de8d12340e5902914fba9f420865dc.tar.lz tangerine-wallet-browser-b5d6452454de8d12340e5902914fba9f420865dc.tar.xz tangerine-wallet-browser-b5d6452454de8d12340e5902914fba9f420865dc.tar.zst tangerine-wallet-browser-b5d6452454de8d12340e5902914fba9f420865dc.zip |
Disallow loading as metamaskNetworkId (#5924)
* transactions - throw an error if a transaction is generated while the network is loading
* add tests for failing when netId is loading
Diffstat (limited to 'app')
-rw-r--r-- | app/scripts/controllers/transactions/tx-state-manager.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/scripts/controllers/transactions/tx-state-manager.js b/app/scripts/controllers/transactions/tx-state-manager.js index 72d869fa8..420191d9c 100644 --- a/app/scripts/controllers/transactions/tx-state-manager.js +++ b/app/scripts/controllers/transactions/tx-state-manager.js @@ -45,11 +45,13 @@ class TransactionStateManager extends EventEmitter { @returns {txMeta} the default txMeta object */ generateTxMeta (opts) { + const netId = this.getNetwork() + if (netId === 'loading') throw new Error('MetaMask is having trouble connecting to the network') return extend({ id: createId(), time: (new Date()).getTime(), status: 'unapproved', - metamaskNetworkId: this.getNetwork(), + metamaskNetworkId: netId, loadingDefaults: true, }, opts) } |