aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-06-04 04:58:09 +0800
committerDan Finlay <dan@danfinlay.com>2016-06-04 04:58:09 +0800
commit2422c78ce20a032a81545bf8cc03394e12c599d5 (patch)
tree104ecf92b55ad23c00348a69c05f159490ec041d
parentd86d7b9ac77c04d4e5800d67f01ec1c859abfbf1 (diff)
downloadtangerine-wallet-browser-2422c78ce20a032a81545bf8cc03394e12c599d5.tar.gz
tangerine-wallet-browser-2422c78ce20a032a81545bf8cc03394e12c599d5.tar.zst
tangerine-wallet-browser-2422c78ce20a032a81545bf8cc03394e12c599d5.zip
Add network loading indication
-rw-r--r--app/scripts/lib/idStore.js6
-rw-r--r--ui/app/components/network.js8
2 files changed, 14 insertions, 0 deletions
diff --git a/app/scripts/lib/idStore.js b/app/scripts/lib/idStore.js
index 4ce4fd6f2..7f2659381 100644
--- a/app/scripts/lib/idStore.js
+++ b/app/scripts/lib/idStore.js
@@ -131,8 +131,10 @@ IdentityStore.prototype.revealAccount = function(cb) {
}
IdentityStore.prototype.getNetwork = function(tries) {
+
if (tries === 0) {
this._currentState.network = 'error'
+ this._didUpdate()
return
}
this.web3.version.getNetwork((err, network) => {
@@ -140,7 +142,11 @@ IdentityStore.prototype.getNetwork = function(tries) {
return this.getNetwork(tries - 1, cb)
}
this._currentState.network = network
+ this._didUpdate()
})
+
+ this._currentState.network = 'loading'
+ this._didUpdate()
}
IdentityStore.prototype.setLocked = function(cb){
diff --git a/ui/app/components/network.js b/ui/app/components/network.js
index 5f507f630..90c307ed6 100644
--- a/ui/app/components/network.js
+++ b/ui/app/components/network.js
@@ -19,6 +19,14 @@ Network.prototype.render = function() {
if (networkNumber == undefined || networkNumber == "error") {
hoverText = 'No Blockchain Connection'
iconName = 'no-connection'
+ } else if (networkNumber == 'loading') {
+ return h('img', {
+ title: 'Contacting network...',
+ style: {
+ width: '27px',
+ },
+ src: 'images/loading.svg',
+ })
} else if (networkNumber == 1) {
hoverText = 'Main Ethereum Network'
iconName = 'ethereum-network'