fix networkStatus

pull/3481/head
yann300 2 years ago
parent 460f32bf10
commit 53cec11285
  1. 6
      apps/remix-ide/src/blockchain/blockchain.js

@ -49,7 +49,7 @@ export class Blockchain extends Plugin {
this.txRunner = new TxRunner(web3Runner, { runAsync: true })
this.networkcallid = 0
this.networkStatus = { name: ' - ', id: ' - ' }
this.networkStatus = { network: { name: ' - ', id: ' - ' } }
this.setupEvents()
this.setupProviders()
}
@ -76,6 +76,10 @@ export class Blockchain extends Plugin {
this.executionContext.event.register('contextChanged', async (context) => {
await this.resetEnvironment()
this._triggerEvent('contextChanged', [context])
this.detectNetwork((error, network) => {
this.networkStatus = { network, error }
this._triggerEvent('networkStatus', [this.networkStatus])
})
})
this.executionContext.event.register('addProvider', (network) => {

Loading…
Cancel
Save