File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed
apps/dashboard/src/app/bridge Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -25,20 +25,25 @@ export default async function BridgePage({
2525} : { searchParams : Promise < Record < string , string | string [ ] > > } ) {
2626 const { chainId, tokenAddress, amount } = await searchParams ;
2727
28- const {
29- symbol,
30- decimals ,
31- name : tokenName ,
32- } = chainId && tokenAddress
33- ? await getCurrencyMetadata ( {
28+ // Replace the existing destructuring block with error‐handled fetch
29+ let symbol , decimals , tokenName ;
30+
31+ if ( chainId && tokenAddress ) {
32+ try {
33+ const metadata = await getCurrencyMetadata ( {
3434 contract : getContract ( {
3535 client : bridgeAppThirdwebClient ,
3636 // eslint-disable-next-line no-restricted-syntax
3737 chain : defineChain ( Number ( chainId ) ) ,
3838 address : tokenAddress as Address ,
3939 } ) ,
40- } )
41- : { } ;
40+ } ) ;
41+ ( { symbol, decimals, name : tokenName } = metadata ) ;
42+ } catch ( error ) {
43+ console . warn ( 'Failed to fetch token metadata:' , error ) ;
44+ // Continue with undefined values; the component should handle gracefully
45+ }
46+ }
4247
4348 return (
4449 < div className = "relative mx-auto flex h-screen w-full flex-col items-center justify-center overflow-hidden border py-10" >
You can’t perform that action at this time.
0 commit comments