update comment

pull/5272/head
aniket-engg 1 month ago committed by Aniket
parent 250798dbaa
commit d70a7e4bf2
  1. 8
      libs/remix-ui/run-tab/src/lib/actions/events.ts

@ -38,6 +38,7 @@ export const setupEvents = (plugin: RunTab) => {
}) })
plugin.blockchain.event.register('contextChanged', async (context) => { plugin.blockchain.event.register('contextChanged', async (context) => {
console.log('contextChanged')
dispatch(resetProxyDeployments()) dispatch(resetProxyDeployments())
if (!context.startsWith('vm')) getNetworkProxyAddresses(plugin, dispatch) if (!context.startsWith('vm')) getNetworkProxyAddresses(plugin, dispatch)
if (context !== 'walletconnect') { if (context !== 'walletconnect') {
@ -45,12 +46,15 @@ export const setupEvents = (plugin: RunTab) => {
} }
setFinalContext(plugin, dispatch) setFinalContext(plugin, dispatch)
fillAccountsList(plugin, dispatch) fillAccountsList(plugin, dispatch)
// 'contextChanged' is triggered on workspace change // 'contextChanged' & 'networkStatus' both are triggered on workspace & network change
// Load pinned contracts for updated workspace // There is chance that pinned contracts state is overrided by othe event
// We load pinned contracts for VM environment in this event
// and for other environments in 'networkStatus' event
if (context.startsWith('vm')) await loadPinnedContracts(plugin, dispatch, context) if (context.startsWith('vm')) await loadPinnedContracts(plugin, dispatch, context)
}) })
plugin.blockchain.event.register('networkStatus', async ({ error, network }) => { plugin.blockchain.event.register('networkStatus', async ({ error, network }) => {
console.log('networkStatus')
if (error) { if (error) {
const netUI = 'can\'t detect network' const netUI = 'can\'t detect network'
setNetworkNameFromProvider(dispatch, netUI) setNetworkNameFromProvider(dispatch, netUI)

Loading…
Cancel
Save