From d49ef1a2e54b0a9ac7a3d23d7744990543246ec6 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Fri, 3 Jun 2016 15:18:20 -0700 Subject: Blockchain status now updates on availability change --- app/scripts/lib/idStore.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'app/scripts/lib') diff --git a/app/scripts/lib/idStore.js b/app/scripts/lib/idStore.js index 7f2659381..85e8c8301 100644 --- a/app/scripts/lib/idStore.js +++ b/app/scripts/lib/idStore.js @@ -130,23 +130,23 @@ IdentityStore.prototype.revealAccount = function(cb) { cb(null) } -IdentityStore.prototype.getNetwork = function(tries) { +IdentityStore.prototype.getNetwork = function(err) { - if (tries === 0) { - this._currentState.network = 'error' + if (err) { + this._currentState.network = 'loading' this._didUpdate() - return } + 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() }) - - this._currentState.network = 'loading' - this._didUpdate() } IdentityStore.prototype.setLocked = function(cb){ -- cgit v1.2.3