Fix type errors

Signed-off-by: Sebastian Martinez <sebastinez@me.com>
This commit is contained in:
Sebastian Martinez
2022-02-02 12:29:20 +01:00
committed by Alexis Sellier
parent 6e1c8a09c8
commit ea0e8bd3d3
12 changed files with 17 additions and 13 deletions
+1 -1
View File
@@ -24,7 +24,7 @@
const onConnect = async () => {
try {
await state.connectWalletConnect(config);
} catch (e) {
} catch (e: any) {
walletConnectState.set({ state: "close" });
error = e;
}
+1 -1
View File
@@ -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 };
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -64,7 +64,7 @@
await tx.wait();
state = State.Success;
}
} catch (e) {
} catch (e: any) {
console.error(e);
state = State.Failed;
error = e.message;
+1 -1
View File
@@ -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 };
}
+1 -1
View File
@@ -51,7 +51,7 @@
} else {
state = State.NameUnavailable;
}
} catch (err) {
} catch (err: any) {
state = State.CheckingFailed;
error = err.message;
}
+1 -1
View File
@@ -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 });
+1 -1
View File
@@ -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 };
}
+6 -2
View File
@@ -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 };
}
}
+1 -1
View File
@@ -63,7 +63,7 @@
await tx.wait();
state = State.Success;
}
} catch (e) {
} catch (e: any) {
console.error(e);
state = State.Failed;
error = e.message;
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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 });