mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-22 17:33:23 +01:00
Add network loading indication
This commit is contained in:
parent
d86d7b9ac7
commit
2422c78ce2
@ -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){
|
||||
|
@ -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'
|
||||
|
Loading…
Reference in New Issue
Block a user