fix adding custom network

pull/4745/head
yann300 7 months ago committed by Aniket
parent 5e0bb520c7
commit dfab722ec8
  1. 4
      apps/remix-ide/src/app/providers/injected-custom-provider.tsx

@ -24,7 +24,9 @@ export class InjectedCustomProvider extends InjectedProviderDefault {
}
await super.init()
if (this.chainName && this.rpcUrls && this.rpcUrls.length > 0) await addCustomNetwork(this.chainName, this.chainId, this.rpcUrls, this.nativeCurrency, this.blockExplorerUrls)
else throw new Error('Cannot add the custom network to main injected provider')
else {
console.log('The custom network is added without rpcUrls, the network need to be already installed in the injected provider.')
}
return {}
}
}

Loading…
Cancel
Save