fix event listening

pull/3481/head
yann300 2 years ago
parent 42a9174c2e
commit 460f32bf10
  1. 7
      libs/remix-ui/run-tab/src/lib/actions/events.ts

@ -29,6 +29,8 @@ export const setupEvents = (plugin: RunTab, dispatch: React.Dispatch<any>) => {
dispatch(resetProxyDeployments()) dispatch(resetProxyDeployments())
if (!context.startsWith('vm')) getNetworkProxyAddresses(plugin, dispatch) if (!context.startsWith('vm')) getNetworkProxyAddresses(plugin, dispatch)
setFinalContext(plugin, dispatch) setFinalContext(plugin, dispatch)
fillAccountsList(plugin, dispatch)
updateAccountBalances(plugin, dispatch)
}) })
plugin.blockchain.event.register('networkStatus', ({ error, network }) => { plugin.blockchain.event.register('networkStatus', ({ error, network }) => {
@ -127,11 +129,6 @@ export const setupEvents = (plugin: RunTab, dispatch: React.Dispatch<any>) => {
dispatch(fetchAccountsListSuccess(accountsMap)) dispatch(fetchAccountsListSuccess(accountsMap))
}) })
plugin.on('blockchain', 'contextChanged', () => {
fillAccountsList(plugin, dispatch)
updateAccountBalances(plugin, dispatch)
})
setInterval(() => { setInterval(() => {
fillAccountsList(plugin, dispatch) fillAccountsList(plugin, dispatch)
updateInstanceBalance(plugin, dispatch) updateInstanceBalance(plugin, dispatch)

Loading…
Cancel
Save