Skip to content

Commit 99cea8b

Browse files
committed
fix: localhost ub domains
1 parent c82c978 commit 99cea8b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

apps/playground-web/src/hooks/useTokensData.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ import { useQuery } from "@tanstack/react-query";
44
import type { TokenMetadata } from "@/lib/types";
55

66
async function fetchTokensFromApi(chainId?: number) {
7-
const domain = process.env.NEXT_PUBLIC_BRIDGE_URL;
8-
const url = new URL(`https://${domain}/v1/tokens`);
7+
const domain = process.env.NEXT_PUBLIC_BRIDGE_URL || "bridge.thirdweb.com";
8+
const url = new URL(
9+
`${domain.includes("localhost") ? "http" : "https"}://${domain}/v1/tokens`,
10+
);
911

1012
if (chainId) {
1113
url.searchParams.append("chainId", String(chainId));

0 commit comments

Comments
 (0)