fix: Load plain dynamically (#18571)

This commit is contained in:
Omar López
2025-01-22 20:10:11 +00:00
committed by GitHub
parent f0d1c92e99
commit 0f07ab2f7b
6 changed files with 9 additions and 5 deletions
+1 -1
View File
@@ -112,7 +112,7 @@ NEXT_PUBLIC_POSTHOG_HOST=
PLAIN_API_KEY=
PLAIN_API_URL=https://api.plain.com/v1
PLAIN_HMAC_SECRET_KEY=
PLAIN_CHAT_ID=
NEXT_PUBLIC_PLAIN_CHAT_ID=
PLAIN_CHAT_HMAC_SECRET_KEY=
NEXT_PUBLIC_PLAIN_CHAT_EXCLUDED_PATHS=
+1 -1
View File
@@ -38,7 +38,7 @@ async function handler(request: Request) {
hash,
email: session.user.email || "user@example.com",
shortName,
appId: process.env.PLAIN_CHAT_ID,
appId: process.env.NEXT_PUBLIC_PLAIN_CHAT_ID,
fullName: session.user.name || "User",
chatAvatarUrl: session.user.avatarUrl || "",
});
+1 -1
View File
@@ -21,7 +21,7 @@ import { useFlags } from "@calcom/features/flags/hooks";
import useIsBookingPage from "@lib/hooks/useIsBookingPage";
import useIsThemeSupported from "@lib/hooks/useIsThemeSupported";
import PlainChat from "@lib/plain/plainChat";
import PlainChat from "@lib/plain/dynamicProvider";
import type { WithLocaleProps } from "@lib/withLocale";
import type { WithNonceProps } from "@lib/withNonce";
+1 -1
View File
@@ -20,7 +20,7 @@ import { useFlags } from "@calcom/features/flags/hooks";
import { MetaProvider } from "@calcom/ui";
import useIsBookingPage from "@lib/hooks/useIsBookingPage";
import PlainChat from "@lib/plain/plainChat";
import PlainChat from "@lib/plain/dynamicProvider";
import type { WithLocaleProps } from "@lib/withLocale";
import type { WithNonceProps } from "@lib/withNonce";
+4
View File
@@ -0,0 +1,4 @@
import dynamic from "next/dynamic";
import { Fragment } from "react";
export default process.env.NEXT_PUBLIC_PLAIN_CHAT_ID ? dynamic(() => import("./plainChat")) : Fragment;
+1 -1
View File
@@ -120,7 +120,7 @@
"PLAIN_HMAC_SECRET_KEY",
"PLAIN_API_KEY",
"PLAIN_API_URL",
"PLAIN_CHAT_ID",
"NEXT_PUBLIC_PLAIN_CHAT_ID",
"PLAIN_CHAT_HMAC_SECRET_KEY",
"NEXT_PUBLIC_PLAIN_CHAT_EXCLUDED_PATHS"
]