Deactivate walletconnect only if walletconnect is active

pull/5370/head
ioedeveloper 2 years ago committed by Aniket
parent 25fcdbace0
commit 8d7bb9bb09
  1. 2
      apps/remix-ide/src/app/udapp/run-tab.js
  2. 2
      apps/walletconnect/src/services/RemixClient.ts
  3. 6
      libs/remix-ui/run-tab/src/lib/actions/events.ts

@ -170,7 +170,7 @@ export class RunTab extends ViewPlugin {
await addProvider('injected-optimism-provider', 'L2 - Optimism Provider', true, false)
await addProvider('injected-arbitrum-one-provider', 'L2 - Arbitrum One Provider', true, false)
// await addProvider('walletconnect', 'WalletConnect', false, false)
await addProvider('walletconnect', 'WalletConnect', false, false)
}

@ -32,7 +32,7 @@ export class RemixClient extends PluginClient {
async initClient () {
try {
this.chains = [arbitrum, mainnet, polygon, optimism, goerli, sepolia]
this.chains = [arbitrum, arbitrumGoerli, mainnet, polygon, polygonMumbai, optimism, optimismGoerli, goerli, sepolia]
const { provider } = configureChains(this.chains, [w3mProvider({ projectId: PROJECT_ID })])
this.wagmiClient = wagmiCreateClient({

@ -25,10 +25,12 @@ export const setupEvents = (plugin: RunTab, dispatch: React.Dispatch<any>) => {
updateInstanceBalance(plugin, dispatch)
})
plugin.blockchain.event.register('contextChanged', (context) => {
plugin.blockchain.event.register('contextChanged', async (context) => {
dispatch(resetProxyDeployments())
if (!context.startsWith('vm')) getNetworkProxyAddresses(plugin, dispatch)
if (context !== 'walletconnect') plugin.call('manager', 'deactivatePlugin', 'walletconnect')
if (context !== 'walletconnect') {
(await plugin.call('manager', 'isActive', 'walletconnect')) && plugin.call('manager', 'deactivatePlugin', 'walletconnect')
}
setFinalContext(plugin, dispatch)
fillAccountsList(plugin, dispatch)
updateAccountBalances(plugin, dispatch)

Loading…
Cancel
Save