Skip to content

Commit 68a5475

Browse files
committed
refactor: enhance type safety for token metadata in BridgePage
- Updated variable declarations for symbol, decimals, and tokenName to include explicit types. - Improved error handling for token metadata fetching with consistent logging format.
1 parent 0d8523b commit 68a5475

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ export default async function BridgePage({
2525
}: { searchParams: Promise<Record<string, string | string[]>> }) {
2626
const { chainId, tokenAddress, amount } = await searchParams;
2727

28-
// Replace the existing destructuring block with error‐handled fetch
29-
let symbol, decimals, tokenName;
28+
let symbol: string | undefined;
29+
let decimals: number | undefined;
30+
let tokenName: string | undefined;
3031

3132
if (chainId && tokenAddress) {
3233
try {
@@ -40,7 +41,7 @@ export default async function BridgePage({
4041
});
4142
({ symbol, decimals, name: tokenName } = metadata);
4243
} catch (error) {
43-
console.warn('Failed to fetch token metadata:', error);
44+
console.warn("Failed to fetch token metadata:", error);
4445
// Continue with undefined values; the component should handle gracefully
4546
}
4647
}

0 commit comments

Comments
 (0)