Skip to content

Commit fd130a3

Browse files
authored
chore: don't use object in dependency (calcom#26972)
1 parent 7ec8601 commit fd130a3

1 file changed

Lines changed: 38 additions & 24 deletions

File tree

apps/web/modules/bookings/components/Booker.tsx

Lines changed: 38 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,40 @@
1-
import { AnimatePresence, LazyMotion, m } from "framer-motion";
2-
import { useEffect, useMemo, useRef } from "react";
3-
import StickyBox from "react-sticky-box";
4-
import { Toaster } from "sonner";
5-
import { shallow } from "zustand/shallow";
6-
1+
import process from "node:process";
72
import BookingPageTagManager from "@calcom/app-store/BookingPageTagManager";
83
import { useIsPlatformBookerEmbed } from "@calcom/atoms/hooks/useIsPlatformBookerEmbed";
94
import dayjs from "@calcom/dayjs";
10-
import PoweredBy from "@calcom/web/modules/ee/common/components/PoweredBy";
115
import { useEmbedUiConfig } from "@calcom/embed-core/embed-iframe";
126
import { updateEmbedBookerState } from "@calcom/embed-core/src/embed-iframe";
137
import TurnstileCaptcha from "@calcom/features/auth/Turnstile";
148
import { useBookerStoreContext } from "@calcom/features/bookings/Booker/BookerStoreProvider";
9+
import { useIsQuickAvailabilityCheckFeatureEnabled } from "@calcom/features/bookings/Booker/components/hooks/useIsQuickAvailabilityCheckFeatureEnabled";
1510
import useSkipConfirmStep from "@calcom/features/bookings/Booker/components/hooks/useSkipConfirmStep";
11+
import {
12+
fadeInLeft,
13+
getBookerSizeClassNames,
14+
useBookerResizeAnimation,
15+
} from "@calcom/features/bookings/Booker/config";
16+
import framerFeatures from "@calcom/features/bookings/Booker/framer-features";
17+
import type { BookerProps, WrappedBookerProps } from "@calcom/features/bookings/Booker/types";
18+
import { isBookingDryRun } from "@calcom/features/bookings/Booker/utils/isBookingDryRun";
19+
import { isTimeSlotAvailable } from "@calcom/features/bookings/Booker/utils/isTimeslotAvailable";
1620
import { getQueryParam } from "@calcom/features/bookings/Booker/utils/query-param";
1721
import { useNonEmptyScheduleDays } from "@calcom/features/schedules/lib/use-schedule/useNonEmptyScheduleDays";
1822
import { scrollIntoViewSmooth } from "@calcom/lib/browser/browser.utils";
19-
import { PUBLIC_INVALIDATE_AVAILABLE_SLOTS_ON_BOOKING_FORM } from "@calcom/lib/constants";
20-
import { CLOUDFLARE_SITE_ID, CLOUDFLARE_USE_TURNSTILE_IN_BOOKER } from "@calcom/lib/constants";
23+
import {
24+
CLOUDFLARE_SITE_ID,
25+
CLOUDFLARE_USE_TURNSTILE_IN_BOOKER,
26+
PUBLIC_INVALIDATE_AVAILABLE_SLOTS_ON_BOOKING_FORM,
27+
} from "@calcom/lib/constants";
2128
import { useCompatSearchParams } from "@calcom/lib/hooks/useCompatSearchParams";
2229
import { BookerLayouts } from "@calcom/prisma/zod-utils";
2330
import classNames from "@calcom/ui/classNames";
2431
import { UnpublishedEntity } from "@calcom/ui/components/unpublished-entity";
25-
26-
import { VerifyCodeDialog } from "./VerifyCodeDialog";
32+
import PoweredBy from "@calcom/web/modules/ee/common/components/PoweredBy";
33+
import { AnimatePresence, LazyMotion, m } from "framer-motion";
34+
import { useEffect, useMemo, useRef } from "react";
35+
import StickyBox from "react-sticky-box";
36+
import { Toaster } from "sonner";
37+
import { shallow } from "zustand/shallow";
2738
import { AvailableTimeSlots } from "./AvailableTimeSlots";
2839
import { BookEventForm } from "./BookEventForm";
2940
import { BookFormAsModal } from "./BookEventForm/BookFormAsModal";
@@ -38,12 +49,7 @@ import { OverlayCalendar } from "./OverlayCalendar/OverlayCalendar";
3849
import { RedirectToInstantMeetingModal } from "./RedirectToInstantMeetingModal";
3950
import { BookerSection } from "./Section";
4051
import { NotFound } from "./Unavailable";
41-
import { useIsQuickAvailabilityCheckFeatureEnabled } from "@calcom/features/bookings/Booker/components/hooks/useIsQuickAvailabilityCheckFeatureEnabled";
42-
import { fadeInLeft, getBookerSizeClassNames, useBookerResizeAnimation } from "@calcom/features/bookings/Booker/config";
43-
import framerFeatures from "@calcom/features/bookings/Booker/framer-features";
44-
import type { BookerProps, WrappedBookerProps } from "@calcom/features/bookings/Booker/types";
45-
import { isBookingDryRun } from "@calcom/features/bookings/Booker/utils/isBookingDryRun";
46-
import { isTimeSlotAvailable } from "@calcom/features/bookings/Booker/utils/isTimeslotAvailable";
52+
import { VerifyCodeDialog } from "./VerifyCodeDialog";
4753

4854
const BookerComponent = ({
4955
username,
@@ -219,16 +225,24 @@ const BookerComponent = ({
219225
if (selectedTimeslot && skipConfirmStep && isSkipConfirmStepSupported)
220226
return setBookerState("selecting_time");
221227
return setBookerState("booking");
222-
}, [event, selectedDate, selectedTimeslot, setBookerState, skipConfirmStep, layout, isInstantMeeting]);
228+
}, [
229+
event.isPending,
230+
selectedDate,
231+
selectedTimeslot,
232+
setBookerState,
233+
skipConfirmStep,
234+
layout,
235+
isInstantMeeting,
236+
]);
223237

224238
const unavailableTimeSlots = isQuickAvailabilityCheckFeatureEnabled
225239
? allSelectedTimeslots.filter((slot) => {
226-
return !isTimeSlotAvailable({
227-
scheduleData: schedule?.data ?? null,
228-
slotToCheckInIso: slot,
229-
quickAvailabilityChecks: slots.quickAvailabilityChecks,
230-
});
231-
})
240+
return !isTimeSlotAvailable({
241+
scheduleData: schedule?.data ?? null,
242+
slotToCheckInIso: slot,
243+
quickAvailabilityChecks: slots.quickAvailabilityChecks,
244+
});
245+
})
232246
: [];
233247

234248
const slot = getQueryParam("slot");

0 commit comments

Comments
 (0)