fix: BookerEmbed breaking (#27143)
This commit is contained in:
@@ -217,8 +217,10 @@ const BookerComponent = ({
|
||||
);
|
||||
|
||||
// Cloudflare Turnstile Captcha
|
||||
// Note: process.env may be undefined in embed contexts, so we safely check it
|
||||
const isE2E = typeof process !== "undefined" && process.env?.NEXT_PUBLIC_IS_E2E;
|
||||
const shouldRenderCaptcha = !!(
|
||||
!process.env.NEXT_PUBLIC_IS_E2E &&
|
||||
!isE2E &&
|
||||
renderCaptcha &&
|
||||
CLOUDFLARE_SITE_ID &&
|
||||
CLOUDFLARE_USE_TURNSTILE_IN_BOOKER === "1" &&
|
||||
|
||||
@@ -3,9 +3,9 @@ import { getCookie } from "@calcom/lib/cookie";
|
||||
/**
|
||||
* NOTE: Feature can be easily rolled back by setting percentage to 0
|
||||
*/
|
||||
export const isVisitorWithinPercentage = ({ percentage }: { percentage: number }) => {
|
||||
export const isVisitorWithinPercentage = ({ percentage }: { percentage: number }): boolean => {
|
||||
// E2E tests must test all features regardless of their rollout percentage
|
||||
if (process.env.NEXT_PUBLIC_IS_E2E) {
|
||||
if (typeof process !== "undefined" && process.env?.NEXT_PUBLIC_IS_E2E) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user