fix: Load plain dynamically (#18571)
This commit is contained in:
1 parent
f0d1c92e99
commit
0f07ab2f7b
6 files changed
+9
-5
No files matched your search
+1
-1
@@ -112,7 +112,7 @@ NEXT_PUBLIC_POSTHOG_HOST=
|
|||||||
PLAIN_API_KEY=
|
PLAIN_API_KEY=
|
||||||
PLAIN_API_URL=https://api.plain.com/v1
|
PLAIN_API_URL=https://api.plain.com/v1
|
||||||
PLAIN_HMAC_SECRET_KEY=
|
PLAIN_HMAC_SECRET_KEY=
|
||||||
PLAIN_CHAT_ID=
|
NEXT_PUBLIC_PLAIN_CHAT_ID=
|
||||||
PLAIN_CHAT_HMAC_SECRET_KEY=
|
PLAIN_CHAT_HMAC_SECRET_KEY=
|
||||||
NEXT_PUBLIC_PLAIN_CHAT_EXCLUDED_PATHS=
|
NEXT_PUBLIC_PLAIN_CHAT_EXCLUDED_PATHS=
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ async function handler(request: Request) {
|
|||||||
hash,
|
hash,
|
||||||
email: session.user.email || "[email protected]",
|
email: session.user.email || "[email protected]",
|
||||||
shortName,
|
shortName,
|
||||||
appId: process.env.PLAIN_CHAT_ID,
|
appId: process.env.NEXT_PUBLIC_PLAIN_CHAT_ID,
|
||||||
fullName: session.user.name || "User",
|
fullName: session.user.name || "User",
|
||||||
chatAvatarUrl: session.user.avatarUrl || "",
|
chatAvatarUrl: session.user.avatarUrl || "",
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import { useFlags } from "@calcom/features/flags/hooks";
|
|||||||
|
|
||||||
import useIsBookingPage from "@lib/hooks/useIsBookingPage";
|
import useIsBookingPage from "@lib/hooks/useIsBookingPage";
|
||||||
import useIsThemeSupported from "@lib/hooks/useIsThemeSupported";
|
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 { WithLocaleProps } from "@lib/withLocale";
|
||||||
import type { WithNonceProps } from "@lib/withNonce";
|
import type { WithNonceProps } from "@lib/withNonce";
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import { useFlags } from "@calcom/features/flags/hooks";
|
|||||||
import { MetaProvider } from "@calcom/ui";
|
import { MetaProvider } from "@calcom/ui";
|
||||||
|
|
||||||
import useIsBookingPage from "@lib/hooks/useIsBookingPage";
|
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 { WithLocaleProps } from "@lib/withLocale";
|
||||||
import type { WithNonceProps } from "@lib/withNonce";
|
import type { WithNonceProps } from "@lib/withNonce";
|
||||||
|
|
||||||
|
|||||||
@@ -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
@@ -120,7 +120,7 @@
|
|||||||
"PLAIN_HMAC_SECRET_KEY",
|
"PLAIN_HMAC_SECRET_KEY",
|
||||||
"PLAIN_API_KEY",
|
"PLAIN_API_KEY",
|
||||||
"PLAIN_API_URL",
|
"PLAIN_API_URL",
|
||||||
"PLAIN_CHAT_ID",
|
"NEXT_PUBLIC_PLAIN_CHAT_ID",
|
||||||
"PLAIN_CHAT_HMAC_SECRET_KEY",
|
"PLAIN_CHAT_HMAC_SECRET_KEY",
|
||||||
"NEXT_PUBLIC_PLAIN_CHAT_EXCLUDED_PATHS"
|
"NEXT_PUBLIC_PLAIN_CHAT_EXCLUDED_PATHS"
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in new issue
Block a user