Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Fix type errors
Sebastian Martinez committed 4 years ago
commit ea0e8bd3d3923c70b87dd20f215b69e15caaa235
parent 6e1c8a09c8c11bfb6ffc8c00a72d7d9f8bf52f7d
12 files changed +17 -13
modified src/Connect.svelte
@@ -24,7 +24,7 @@
  const onConnect = async () => {
    try {
      await state.connectWalletConnect(config);
-
    } catch (e) {
+
    } catch (e: any) {
      walletConnectState.set({ state: "close" });
      error = e;
    }
modified src/base/faucet/Withdraw.svelte
@@ -28,7 +28,7 @@
      state.status = Status.Pending;
      await tx.wait();
      state.status = Status.Success;
-
    } catch (e) {
+
    } catch (e: any) {
      console.error(e);
      error = e;
      state = { status: Status.Failed, error: e.message };
modified src/base/orgs/Create.svelte
@@ -63,7 +63,7 @@
      let receipt = await tx.wait();
      org = Org.fromReceipt(receipt);
      state = State.Success;
-
    } catch (e) {
+
    } catch (e: any) {
      console.error(e);

      state = State.Idle;
modified src/base/orgs/TransferOwnership.svelte
@@ -64,7 +64,7 @@
        await tx.wait();
        state = State.Success;
      }
-
    } catch (e) {
+
    } catch (e: any) {
      console.error(e);
      state = State.Failed;
      error = e.message;
modified src/base/projects/Widget.svelte
@@ -29,7 +29,7 @@
      const result = await proj.getInfo(project.id, config);
      state = { status: Status.Loaded };
      info = result;
-
    } catch (err) {
+
    } catch (err: any) {
      console.error(err.message);
      state = { status: Status.Error, error: err.message };
    }
modified src/base/registrations/New.svelte
@@ -51,7 +51,7 @@
      } else {
        state = State.NameUnavailable;
      }
-
    } catch (err) {
+
    } catch (err: any) {
      state = State.CheckingFailed;
      error = err.message;
    }
modified src/base/registrations/Submit.svelte
@@ -25,7 +25,7 @@
  onMount(async () => {
    try {
      await registerName(subdomain, registrationOwner, config);
-
    } catch (e) {
+
    } catch (e: any) {
      console.error("Error", e);

      state.set({ connection: State.Failed });
modified src/base/registrations/Update.svelte
@@ -24,7 +24,7 @@
      state.status = Status.Pending;
      await tx.wait();
      state.status = Status.Success;
-
    } catch (e) {
+
    } catch (e: any) {
      console.error(e);
      state = { status: Status.Failed, error: e.message };
    }
modified src/base/registrations/registrar.ts
@@ -138,7 +138,11 @@ export async function getSeed(name: string, config: Config, resolver?: EnsResolv
    resolver.getText('eth.radicle.seed.api'),
  ]);

-
  return new Seed(host, id, git, api);
+
  if (! host || ! id) {
+
    return null;
+
  }
+

+
  return new Seed(host, id, git ?? undefined, api ?? undefined);
}

export function registrar(config: Config): ethers.Contract {
@@ -166,7 +170,7 @@ export async function registerName(name: string, owner: string, config: Config):
    } else {
      await commitAndRegister(name, owner, config);
    }
-
  } catch (e) {
+
  } catch (e: any) {
    throw { type: e.type || Failure.TransactionFailed, message: e.message, txHash: e.txHash };
  }
}
modified src/ens/SetName.svelte
@@ -63,7 +63,7 @@
          await tx.wait();
          state = State.Success;
        }
-
      } catch (e) {
+
      } catch (e: any) {
        console.error(e);
        state = State.Failed;
        error = e.message;
modified src/profile.ts
@@ -147,7 +147,7 @@ export class Profile {
          formatCAIP10Address(address, "eip155", config.network.chainId), config
        );
        return { address, idx: idx ?? undefined };
-
      } catch (e) {
+
      } catch (e: any) {
        // Look for the No DID found for error by the resolveIdxProfile fn and send it to console.debug
        if (e.message.match("No DID found for")) console.debug(e.message);
        else console.error(e);
modified src/session.ts
@@ -133,7 +133,7 @@ export const loadState = (initial: State): Store => {
        });

        store.set({ connection: Connection.Connected, session });
-
      } catch (e) {
+
      } catch (e: any) {
        console.log("WalletConnect: connection failed.");
        store.set({ connection: Connection.Disconnected });