aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/controllers
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2018-06-07 07:46:39 +0800
committerDan Finlay <dan@danfinlay.com>2018-06-07 07:46:39 +0800
commitc53c5d5c9e2a384c6b0a17b844919f9fff9f960e (patch)
tree6aceb8b7ef83a573776fceadbc65300815ace182 /app/scripts/controllers
parentaea9491f6a7888bd15a9d3dd7858bcda16f1e532 (diff)
downloadtangerine-wallet-browser-c53c5d5c9e2a384c6b0a17b844919f9fff9f960e.tar.gz
tangerine-wallet-browser-c53c5d5c9e2a384c6b0a17b844919f9fff9f960e.tar.zst
tangerine-wallet-browser-c53c5d5c9e2a384c6b0a17b844919f9fff9f960e.zip
Fix bug where reset account would not work.
Fixes #4462 Ensures that resetAccount() can work on non-stock providers. I'm unclear how this was ever working, this code hasn't moved in months, but users report it recently breaking. Maybe we only recently pushed it to prod.
Diffstat (limited to 'app/scripts/controllers')
-rw-r--r--app/scripts/controllers/network/network.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/app/scripts/controllers/network/network.js b/app/scripts/controllers/network/network.js
index 93fde7c57..5e0c63e7d 100644
--- a/app/scripts/controllers/network/network.js
+++ b/app/scripts/controllers/network/network.js
@@ -89,14 +89,21 @@ module.exports = class NetworkController extends EventEmitter {
type: 'rpc',
rpcTarget,
}
- this.providerStore.updateState(providerConfig)
- this._switchNetwork(providerConfig)
+ this.providerConfig = providerConfig
}
async setProviderType (type) {
assert.notEqual(type, 'rpc', `NetworkController - cannot call "setProviderType" with type 'rpc'. use "setRpcTarget"`)
assert(INFURA_PROVIDER_TYPES.includes(type) || type === LOCALHOST, `NetworkController - Unknown rpc type "${type}"`)
const providerConfig = { type }
+ this.providerConfig = providerConfig
+ }
+
+ resetConnection () {
+ this.providerConfig = this.getProviderConfig()
+ }
+
+ set providerConfig (providerConfig) {
this.providerStore.updateState(providerConfig)
this._switchNetwork(providerConfig)
}