diff --git a/.changeset/deep-owls-hang.md b/.changeset/deep-owls-hang.md new file mode 100644 index 0000000000..2910210fd6 --- /dev/null +++ b/.changeset/deep-owls-hang.md @@ -0,0 +1,5 @@ +--- +"@calcom/atoms": minor +--- + +fix: EventTypeSettings Atom crashes on enabling `Lock timezone on booking` in advanced tab diff --git a/packages/features/eventtypes/components/tabs/advanced/EventAdvancedTab.tsx b/packages/features/eventtypes/components/tabs/advanced/EventAdvancedTab.tsx index dced1ca619..b88bbdaec7 100644 --- a/packages/features/eventtypes/components/tabs/advanced/EventAdvancedTab.tsx +++ b/packages/features/eventtypes/components/tabs/advanced/EventAdvancedTab.tsx @@ -1,4 +1,4 @@ -import { useState, Suspense } from "react"; +import { useState, Suspense, useMemo } from "react"; import type { Dispatch, SetStateAction } from "react"; import { Controller, useFormContext } from "react-hook-form"; import type { z } from "zod"; @@ -10,9 +10,10 @@ import { SelectedCalendarSettingsScope, SelectedCalendarsSettingsWebWrapperSkeleton, } from "@calcom/atoms/selected-calendars/wrappers/SelectedCalendarsSettingsWebWrapper"; +import { Timezone as PlatformTimzoneSelect } from "@calcom/atoms/timezone"; import getLocationsOptionsForSelect from "@calcom/features/bookings/lib/getLocationOptionsForSelect"; import DestinationCalendarSelector from "@calcom/features/calendars/DestinationCalendarSelector"; -import { TimezoneSelect } from "@calcom/features/components/timezone-select"; +import { TimezoneSelect as WebTimezoneSelect } from "@calcom/features/components/timezone-select"; import useLockedFieldsManager from "@calcom/features/ee/managed-event-types/hooks/useLockedFieldsManager"; import { allowDisablingAttendeeConfirmationEmails, @@ -565,6 +566,10 @@ export const EventAdvancedTab = ({ userEmail = removePlatformClientIdFromEmail(userEmail, platformContext.clientId); } + const TimezoneSelect = useMemo(() => { + return isPlatform ? PlatformTimzoneSelect : WebTimezoneSelect; + }, [isPlatform]); + return (