Skip to content

Commit 780a96f

Browse files
committed
fix(Navigation): handle empty env app url case
Ensure globalHomeHref falls back to tenantSelectionHref or "/" when NEXT_PUBLIC_APP_URL is empty or whitespace
1 parent 7f552a6 commit 780a96f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/components/Navigation/index.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,11 @@ export default function Navigation({
4545
const theme = useTheme();
4646
const logoSrc = primaryLogo?.url || null;
4747
const logoAlt = primaryLogo?.alt || "Logo";
48+
const envAppUrl = process.env.NEXT_PUBLIC_APP_URL;
4849
const globalHomeHref =
49-
tenantSelectionHref ??
50-
process.env.NEXT_PUBLIC_APP_URL ??
51-
"/";
50+
envAppUrl && envAppUrl.trim().length > 0
51+
? envAppUrl
52+
: (tenantSelectionHref ?? "/");
5253
const logoHref = globalHomeHref;
5354
const isExternalLogoHref =
5455
logoHref.startsWith("http://") ||

0 commit comments

Comments
 (0)