File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed
apps/dashboard/src/components/contract-components Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff 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 } ) ;
You can’t perform that action at this time.
0 commit comments