Skip to content

Commit 0d8523b

Browse files
Update apps/dashboard/src/app/bridge/page.tsx
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: greg <[email protected]>
1 parent 4e94610 commit 0d8523b

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

apps/dashboard/src/app/bridge/page.tsx

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff 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">

0 commit comments

Comments
 (0)