From 460f32bf1043c6a427221592832353f0cce6fa58 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 7 Mar 2023 11:17:01 +0100 Subject: [PATCH] fix event listening --- libs/remix-ui/run-tab/src/lib/actions/events.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/libs/remix-ui/run-tab/src/lib/actions/events.ts b/libs/remix-ui/run-tab/src/lib/actions/events.ts index 52727a5d7e..e53ba8e406 100644 --- a/libs/remix-ui/run-tab/src/lib/actions/events.ts +++ b/libs/remix-ui/run-tab/src/lib/actions/events.ts @@ -29,6 +29,8 @@ export const setupEvents = (plugin: RunTab, dispatch: React.Dispatch) => { dispatch(resetProxyDeployments()) if (!context.startsWith('vm')) getNetworkProxyAddresses(plugin, dispatch) setFinalContext(plugin, dispatch) + fillAccountsList(plugin, dispatch) + updateAccountBalances(plugin, dispatch) }) plugin.blockchain.event.register('networkStatus', ({ error, network }) => { @@ -127,11 +129,6 @@ export const setupEvents = (plugin: RunTab, dispatch: React.Dispatch) => { dispatch(fetchAccountsListSuccess(accountsMap)) }) - plugin.on('blockchain', 'contextChanged', () => { - fillAccountsList(plugin, dispatch) - updateAccountBalances(plugin, dispatch) - }) - setInterval(() => { fillAccountsList(plugin, dispatch) updateInstanceBalance(plugin, dispatch)