Skip to content

Scheduling infrastructure for absolutely everyone.

fix: Handle booker UI busy or skip on timeslot (#18553)

sean-brydon23c93d75ca52
diff --git a/packages/features/bookings/components/AvailableTimes.tsx b/packages/features/bookings/components/AvailableTimes.tsx
index 33a690db23a..61cb28ec0e5 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,