Merge pull request #2932 from Safelite/feature/CASH-1813
CASH-1813: Mobile First defect fixes
This commit is contained in:
commit
b8da057287
1 changed files with 15 additions and 7 deletions
|
|
@ -1741,7 +1741,7 @@ export default {
|
|||
setSelectedDateToFirstAvailable() {
|
||||
this.selectedDate = this.getFirstAvailableDate();
|
||||
},
|
||||
showMobileFirstModal() {
|
||||
async showMobileFirstModal() {
|
||||
if (this.appointmentType == AppointmentTypeStrings.MOBILE) {
|
||||
const isShowMobileFirstAppt = experimentMixin.methods.hasSettingEqualTo(
|
||||
experimentSettings.SHOW_MOBILE_FIRST_APPT,
|
||||
|
|
@ -1759,18 +1759,24 @@ export default {
|
|||
|
||||
let preSelectedMobileAppointment = null;
|
||||
const todaysDate = getTodayDate();
|
||||
let firstMobilePMAppt = this.getFirstAvailableMobileApptByTOD("PM");
|
||||
if (!firstMobilePMAppt) {
|
||||
let firstMobileAMAppt = await this.getFirstAvailableMobileApptByTOD("AM");
|
||||
let firstMobilePMAppt = await this.getFirstAvailableMobileApptByTOD("PM");
|
||||
if (!firstMobileAMAppt && !firstMobilePMAppt) {
|
||||
return;
|
||||
}
|
||||
let firstMobileAMDate = firstMobileAMAppt ? firstMobileAMAppt.date : null;
|
||||
let firstMobilePMDate = firstMobilePMAppt ? firstMobilePMAppt.date : null;
|
||||
let numberOfDaysToFirstMobileAMDate =
|
||||
(new Date(firstMobileAMDate) - todaysDate) / (1000 * 60 * 60 * 24);
|
||||
let numberOfDaysToFirstMobilePMDate =
|
||||
(new Date(firstMobilePMDate) - todaysDate) / (1000 * 60 * 60 * 24);
|
||||
|
||||
const shouldExposeMobileFirstAppointment = () => {
|
||||
return (
|
||||
firstMobilePMDate &&
|
||||
numberOfDaysToFirstMobilePMDate <= noMobileAvailableDays
|
||||
(firstMobileAMDate &&
|
||||
numberOfDaysToFirstMobileAMDate <= noMobileAvailableDays) ||
|
||||
(firstMobilePMDate &&
|
||||
numberOfDaysToFirstMobilePMDate <= noMobileAvailableDays)
|
||||
);
|
||||
};
|
||||
|
||||
|
|
@ -1802,7 +1808,6 @@ export default {
|
|||
firstMobilePMDate &&
|
||||
numberOfDaysToFirstMobilePMDate >= noPMMobileDays
|
||||
) {
|
||||
let firstMobileAMAppt = this.getFirstAvailableMobileApptByTOD("AM");
|
||||
preSelectedMobileAppointment = firstMobileAMAppt
|
||||
? firstMobileAMAppt
|
||||
: null;
|
||||
|
|
@ -1818,7 +1823,10 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
getFirstAvailableMobileApptByTOD(timeOfDay) {
|
||||
async getFirstAvailableMobileApptByTOD(timeOfDay) {
|
||||
if (!this.selectableDatesMobile.days) {
|
||||
await this.initializeDatePicker();
|
||||
}
|
||||
if (!this.selectableDatesMobile?.days?.length) {
|
||||
return null;
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue