CASH-2036: If ShowPMMobileDays experiment setting is 0, choose first available appointment

This commit is contained in:
Chris Redelinghuys 2025-12-16 15:14:47 -05:00
parent 4523490776
commit ad69af36a0

View file

@ -1790,18 +1790,26 @@ export default {
}
if (this.isShowMobileFirstAppt) {
if (firstMobilePMDate && numberOfDaysToFirstMobilePMDate <= pmMobileDays) {
if (pmMobileDays == 0) {
// Selects the first available time slot
preSelectedMobileAppointment =
numberOfDaysToFirstMobileAMDate < numberOfDaysToFirstMobilePMDate
? firstMobileAMAppt
: firstMobilePMAppt;
} else if (
firstMobilePMDate &&
numberOfDaysToFirstMobilePMDate <= pmMobileDays
) {
// Selects the first available PM time slot
preSelectedMobileAppointment = firstMobilePMAppt;
} else if (
(firstMobilePMDate &&
numberOfDaysToFirstMobilePMDate >= noPMMobileDays) ||
pmMobileDays == 0
firstMobilePMDate &&
numberOfDaysToFirstMobilePMDate >= noPMMobileDays
) {
// Selects the first available AM time slot. If none, selects the first available PM time slot
preSelectedMobileAppointment = firstMobileAMAppt
? firstMobileAMAppt
: null;
!preSelectedMobileAppointment &&
(preSelectedMobileAppointment = firstMobilePMAppt);
: firstMobilePMAppt;
}
if (preSelectedMobileAppointment) {