aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib/idStore.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/scripts/lib/idStore.js')
-rw-r--r--app/scripts/lib/idStore.js16
1 files changed, 11 insertions, 5 deletions
diff --git a/app/scripts/lib/idStore.js b/app/scripts/lib/idStore.js
index e9fc10cea..33d842d54 100644
--- a/app/scripts/lib/idStore.js
+++ b/app/scripts/lib/idStore.js
@@ -137,16 +137,22 @@ IdentityStore.prototype.revealAccount = function(cb) {
cb(null)
}
-IdentityStore.prototype.getNetwork = function(tries) {
- if (tries === 0) {
- this._currentState.network = 'error'
- return
+IdentityStore.prototype.getNetwork = function(err) {
+
+ if (err) {
+ this._currentState.network = 'loading'
+ this._didUpdate()
}
+
this.web3.version.getNetwork((err, network) => {
if (err) {
- return this.getNetwork(tries - 1, cb)
+ this._currentState.network = 'loading'
+ return this._didUpdate()
}
+
+ console.log('web3.getNetwork returned ' + network)
this._currentState.network = network
+ this._didUpdate()
})
}