From 9288b9c699aaad106cebec61afe3a31e06fda4cf Mon Sep 17 00:00:00 2001 From: Nounspace Ryan Date: Mon, 29 Jul 2024 17:33:44 -0500 Subject: [PATCH] fix: set base website url to origin if available --- src/constants/app.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/constants/app.ts b/src/constants/app.ts index 112b4b3f..1a6cb72b 100644 --- a/src/constants/app.ts +++ b/src/constants/app.ts @@ -1,7 +1,10 @@ export const WEBSITE_URL = process.env.NEXT_PUBLIC_VERCEL_ENV === "preview" - ? `https://${process.env.NEXT_PUBLIC_VERCEL_BRANCH_URL}` + ? typeof window !== "undefined" + ? window.location.origin + : `https://${process.env.NEXT_PUBLIC_VERCEL_BRANCH_URL}` : process.env.NEXT_PUBLIC_URL; + export const APP_FID = process.env.NEXT_PUBLIC_APP_FID ? Number(process.env.NEXT_PUBLIC_APP_FID) : undefined;