Commit 61189b45 authored by ioedeveloper's avatar ioedeveloper

Removed networkcallid in updateNetwork function.

parent fedf6d85
...@@ -49,7 +49,7 @@ class ContractDropdownUI { ...@@ -49,7 +49,7 @@ class ContractDropdownUI {
} }
listenToContextChange () { listenToContextChange () {
this.blockchain.event.register('newExecutionContext', () => { this.blockchain.event.register('contextChanged', () => {
this.blockchain.updateNetwork((err, {name} = {}) => { this.blockchain.updateNetwork((err, {name} = {}) => {
if (err) { if (err) {
console.log(`can't detect network`) console.log(`can't detect network`)
......
...@@ -212,7 +212,6 @@ class SettingsUI { ...@@ -212,7 +212,6 @@ class SettingsUI {
this.event.trigger('clearInstance', []) this.event.trigger('clearInstance', [])
this.updateNetwork() this.updateNetwork()
this.updatePlusButton() this.updatePlusButton()
this.blockchain.event.trigger('newExecutionContext', [])
} }
updatePlusButton () { updatePlusButton () {
......
...@@ -196,17 +196,12 @@ class Blockchain { ...@@ -196,17 +196,12 @@ class Blockchain {
} }
updateNetwork (cb) { updateNetwork (cb) {
this.networkcallid++ this.executionContext.detectNetwork((err, { id, name } = {}) => {
((callid) => { if (err) {
this.executionContext.detectNetwork((err, { id, name } = {}) => { return cb(err)
if (this.networkcallid > callid) return }
this.networkcallid++ cb(null, {id, name})
if (err) { })
return cb(err)
}
cb(null, {id, name})
})
})(this.networkcallid)
} }
detectNetwork (cb) { detectNetwork (cb) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment