fix: disable skip confirm for booker_layout=WEEK_VIEW (#19524)
* fix: disable skip confirm for booker_layout=WEEK_VIEW * Make code clearer --------- Co-authored-by: Hariom Balhara <[email protected]>
This commit is contained in:
1 parent
a44bcafcf2
commit
ca1f84c827
2 files changed
+11
-5
No files matched your search
@@ -165,6 +165,7 @@ const BookerComponent = ({
|
|||||||
bookingForm,
|
bookingForm,
|
||||||
bookerState,
|
bookerState,
|
||||||
isInstantMeeting,
|
isInstantMeeting,
|
||||||
|
layout == BookerLayouts.WEEK_VIEW,
|
||||||
event?.data?.bookingFields
|
event?.data?.bookingFields
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -181,9 +182,11 @@ const BookerComponent = ({
|
|||||||
if (event.isPending) return setBookerState("loading");
|
if (event.isPending) return setBookerState("loading");
|
||||||
if (!selectedDate) return setBookerState("selecting_date");
|
if (!selectedDate) return setBookerState("selecting_date");
|
||||||
if (!selectedTimeslot) return setBookerState("selecting_time");
|
if (!selectedTimeslot) return setBookerState("selecting_time");
|
||||||
if (selectedTimeslot && skipConfirmStep && !isInstantMeeting) return setBookerState("selecting_time");
|
const isSkipConfirmStepSupported = !isInstantMeeting && layout !== BookerLayouts.WEEK_VIEW;
|
||||||
|
if (selectedTimeslot && skipConfirmStep && isSkipConfirmStepSupported)
|
||||||
|
return setBookerState("selecting_time");
|
||||||
return setBookerState("booking");
|
return setBookerState("booking");
|
||||||
}, [event, selectedDate, selectedTimeslot, setBookerState, skipConfirmStep]);
|
}, [event, selectedDate, selectedTimeslot, setBookerState, skipConfirmStep, layout, isInstantMeeting]);
|
||||||
|
|
||||||
const slot = getQueryParam("slot");
|
const slot = getQueryParam("slot");
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ const useSkipConfirmStep = (
|
|||||||
bookingForm: UseBookingFormReturnType["bookingForm"],
|
bookingForm: UseBookingFormReturnType["bookingForm"],
|
||||||
bookerState: BookerState,
|
bookerState: BookerState,
|
||||||
isInstantMeeting: boolean,
|
isInstantMeeting: boolean,
|
||||||
|
isWeekView: boolean,
|
||||||
bookingFields?: BookerEvent["bookingFields"]
|
bookingFields?: BookerEvent["bookingFields"]
|
||||||
) => {
|
) => {
|
||||||
const bookingFormValues = bookingForm.getValues();
|
const bookingFormValues = bookingForm.getValues();
|
||||||
@@ -37,9 +38,11 @@ const useSkipConfirmStep = (
|
|||||||
setCanSkip(false);
|
setCanSkip(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
const isSkipConfirmStepSupported = !isInstantMeeting && !isWeekView;
|
||||||
bookerState === "selecting_time" && !isInstantMeeting && checkSkipStep();
|
if (bookerState === "selecting_time" && isSkipConfirmStepSupported) {
|
||||||
}, [bookingFormValues, bookingFields, rescheduleUid, bookerState]);
|
checkSkipStep();
|
||||||
|
}
|
||||||
|
}, [bookingFormValues, bookingFields, rescheduleUid, bookerState, isWeekView, isInstantMeeting]);
|
||||||
|
|
||||||
return canSkip;
|
return canSkip;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in new issue
Block a user