Skip to content

Commit ad620e5

Browse files
committed
fix: handle empty NEXT_PUBLIC_MAIN_SITE_URL env var in url-config
1 parent 5891cd2 commit ad620e5

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

packages/ui-chrome/src/url-config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
export function resolveHref(href: string): string {
1818
const mainSiteUrl = process.env.NEXT_PUBLIC_MAIN_SITE_URL;
1919

20-
// If no main site URL configured, return original href
21-
if (!mainSiteUrl) {
20+
// If no main site URL configured or it's an empty string, return original href
21+
if (!mainSiteUrl || mainSiteUrl.trim() === "") {
2222
return href;
2323
}
2424

@@ -38,8 +38,8 @@ export function resolveHref(href: string): string {
3838
export function shouldUseNextLink(href: string): boolean {
3939
const mainSiteUrl = process.env.NEXT_PUBLIC_MAIN_SITE_URL;
4040

41-
// If main site URL is set, always use <a> tag
42-
if (mainSiteUrl) {
41+
// If main site URL is set and not empty, always use <a> tag
42+
if (mainSiteUrl && mainSiteUrl.trim() !== "") {
4343
return false;
4444
}
4545

0 commit comments

Comments
 (0)