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({
25
25
} : { searchParams : Promise < Record < string , string | string [ ] > > } ) {
26
26
const { chainId, tokenAddress, amount } = await searchParams ;
27
27
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 ( {
34
34
contract : getContract ( {
35
35
client : bridgeAppThirdwebClient ,
36
36
// eslint-disable-next-line no-restricted-syntax
37
37
chain : defineChain ( Number ( chainId ) ) ,
38
38
address : tokenAddress as Address ,
39
39
} ) ,
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
+ }
42
47
43
48
return (
44
49
< 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