Merge pull request #2974 from Safelite/feature/CASH-2036

CASH-2036: If ShowPMMobileDays experiment setting is 0, choose first available appointment
This commit is contained in:
Chris 2025-12-16 15:26:51 -05:00 committed by GitHub
commit 90e11544d6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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