feat: no domain redirection during vercel preview

This commit is contained in:
DIYgod 2023-05-04 11:02:55 +01:00
parent cf43e98760
commit a60be5d07c
No known key found for this signature in database
1 changed files with 3 additions and 2 deletions

View File

@ -6,7 +6,7 @@ import { useAccountState } from "@crossbell/connect-kit"
import { BlockchainInfo } from "~/components/common/BlockchainInfo"
import { Style } from "~/components/common/Style"
import { useUserRole } from "~/hooks/useUserRole"
import { IS_PROD } from "~/lib/constants"
import { IS_PROD, IS_VERCEL_PREVIEW } from "~/lib/constants"
import { OUR_DOMAIN, SITE_URL } from "~/lib/env"
import { getUserContentsUrl } from "~/lib/user-contents"
import { cn } from "~/lib/utils"
@ -66,7 +66,8 @@ export const SiteLayout: React.FC<SiteLayoutProps> = ({
if (
window.location.host.split(".").slice(-2).join(".") !== OUR_DOMAIN &&
window.location.host !== site.data?.metadata?.content?.custom_domain &&
IS_PROD
IS_PROD &&
!IS_VERCEL_PREVIEW
) {
window.location.href = SITE_URL
}