Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Validate network and reloads on change
Sebastian Martinez committed 4 years ago
commit 442515f0565a76f2a659e379edc68bc0575ed320
parent 01585eaa39d5b9771ac383a5b4ca2e74dc0457e9
2 files changed +6 -0
modified src/config.ts
@@ -35,6 +35,10 @@ export class Config {
    signer: ethers.Signer & TypedDataSigner | null,
  ) {
    let cfg = (<Record<string, any>> config)[network.name];
+
    
+
    if(!config.hasOwnProperty(network.name.toLowerCase())) {
+
      throw `Network ${network.name} is not supported`
+
    }

    this.network = network;
    this.registrar = cfg.registrar;
modified src/session.ts
@@ -164,6 +164,8 @@ export const session = derived(state, s => {
  return null;
});

+
window.ethereum?.on('chainChanged', () => location.reload());
+

// Updates state when user changes accounts
window.ethereum?.on("accountsChanged", state.setChangedAccount);