Skip to content

Commit 6cd1673

Browse files
committed
Fix custom factory publish form
1 parent d14e0c4 commit 6cd1673

File tree

1 file changed

+11
-8
lines changed
  • apps/dashboard/src/components/contract-components

1 file changed

+11
-8
lines changed

apps/dashboard/src/components/contract-components/hooks.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -184,20 +184,23 @@ export function useCustomFactoryAbi(
184184
return undefined;
185185
}
186186

187-
return getContract({
188-
client,
189-
address: contractAddress,
190-
chain,
191-
});
187+
try {
188+
return getContract({
189+
client,
190+
address: contractAddress,
191+
chain,
192+
});
193+
} catch {
194+
return undefined;
195+
}
192196
}, [contractAddress, chain, client]);
193197

194198
return useQuery({
195199
queryKey: ["custom-factory-abi", contract],
196200
queryFn: () => {
197-
if (!contract) {
198-
throw new Error("Contract not found");
201+
if (contract) {
202+
return resolveContractAbi<Abi>(contract);
199203
}
200-
return resolveContractAbi<Abi>(contract);
201204
},
202205
enabled: !!contract,
203206
});

0 commit comments

Comments
 (0)