diff --git a/packages/features/bookings/components/AvailableTimes.tsx b/packages/features/bookings/components/AvailableTimes.tsx index 33a690db23..61cb28ec0e 100644 --- a/packages/features/bookings/components/AvailableTimes.tsx +++ b/packages/features/bookings/components/AvailableTimes.tsx @@ -91,22 +91,17 @@ const SlotItem = ({ const [overlapConfirm, setOverlapConfirm] = useState(false); const onButtonClick = useCallback(() => { - if (!overlayCalendarToggled) { + if (!overlayCalendarToggled || (isOverlapping && overlapConfirm)) { onTimeSelect(slot.time, slot?.attendees || 0, seatsPerTimeSlot, slot.bookingUid); return; } - if (isOverlapping && overlapConfirm) { - setOverlapConfirm(false); - return; - } - if (isOverlapping && !overlapConfirm) { + if (isOverlapping) { setOverlapConfirm(true); return; } - if (!overlapConfirm) { - onTimeSelect(slot.time, slot?.attendees || 0, seatsPerTimeSlot, slot.bookingUid); - } + + onTimeSelect(slot.time, slot?.attendees || 0, seatsPerTimeSlot, slot.bookingUid); }, [ overlayCalendarToggled, isOverlapping,