diff --git a/apps/web/components/booking/pages/AvailabilityPage.tsx b/apps/web/components/booking/pages/AvailabilityPage.tsx index d5deea5a3d..963358095c 100644 --- a/apps/web/components/booking/pages/AvailabilityPage.tsx +++ b/apps/web/components/booking/pages/AvailabilityPage.tsx @@ -110,11 +110,17 @@ const SlotPicker = ({ }) => { const [selectedDate, setSelectedDate] = useState(); const [browsingDate, setBrowsingDate] = useState(); - const { duration } = useRouterQuery("duration"); + let { duration } = useRouterQuery("duration"); const { date, setQuery: setDate } = useRouterQuery("date"); const { month, setQuery: setMonth } = useRouterQuery("month"); const router = useRouter(); + // Showing error if event type doesn't have multiple duration and duration query param exists + const metadata = EventTypeMetaDataSchema.parse(eventType.metadata); + if (!metadata?.multipleDuration && router.query.duration != undefined) { + duration = undefined; + } + const [slotPickerRef] = useAutoAnimate(); useEffect(() => { @@ -263,12 +269,6 @@ const AvailabilityPage = ({ profile, eventType, ...restProps }: Props) => { const shouldAlignCentrally = !isEmbed || shouldAlignCentrallyInEmbed; const isBackgroundTransparent = useIsBackgroundTransparent(); - // Showing error if event type doesn't have multiple duration and duration query param exists - const metadata = EventTypeMetaDataSchema.parse(eventType.metadata); - if (!metadata?.multipleDuration && router.query.duration != undefined) { - router.replace(`/500?error=${encodeURIComponent(t("error_event_type_duration"))}`); - } - const [timeZone, setTimeZone] = useState(); const [timeFormat, setTimeFormat] = useState(detectBrowserTimeFormat);