Scheduling infrastructure for absolutely everyone.
fix: BookerEmbed breaking (#27143)
Rajiv Sahalb6b43c331882
diff --git a/apps/web/modules/bookings/components/Booker.tsx b/apps/web/modules/bookings/components/Booker.tsxindex 2ba1e1dd83b..6030309f0b3 100644--- a/apps/web/modules/bookings/components/Booker.tsx+++ b/apps/web/modules/bookings/components/Booker.tsx@@ -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" &&diff --git a/packages/features/bookings/Booker/utils/isFeatureEnabledForVisitor.ts b/packages/features/bookings/Booker/utils/isFeatureEnabledForVisitor.tsindex d7b576668df..79adcce099c 100644--- a/packages/features/bookings/Booker/utils/isFeatureEnabledForVisitor.ts+++ b/packages/features/bookings/Booker/utils/isFeatureEnabledForVisitor.ts@@ -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;}