CASH-1712 - restrict showAnotherMonth logic to be more specific to avoid loading next month if only one appointment type is available

This commit is contained in:
AdamCaouetteSafelite 2025-10-24 16:18:11 -04:00
parent 36b8ed0ac1
commit 4405c1c3f0

View file

@ -1217,6 +1217,8 @@ export default {
async initializeDatePicker() {
this.selectedDate = null;
const includeMobileTimeSlots = this.isServiceableMobile;
const includeInshopTimeSlots = this.isServiceableInshop || this.isServiceableDropoff;
const datePickerInitialData = await this.$refs.datePicker.loadInitialData({
// setup config options for date-picker
selectableDatesSetting: "custom",
@ -1225,8 +1227,8 @@ export default {
preSelectedDate: this.preSelectedDate,
providerNumber: this.selectedProvider?.providerNumber,
zipCode: this.zipCode,
includeMobileTimeSlots: this.isServiceableMobile,
includeInshopTimeSlots: this.isServiceableInshop || this.isServiceableDropoff,
includeMobileTimeSlots: includeMobileTimeSlots,
includeInshopTimeSlots: includeInshopTimeSlots,
});
datePickerInitialData.pricingByDayBasePrice = this.pricingByDayBasePrice;
datePickerInitialData.pricingByDayUpcharge = this.pricingByDayUpcharge;
@ -1242,8 +1244,8 @@ export default {
} else {
// if no date is preselected on load, make sure there are some dates available
if (
this.selectableDatesInshop.days.length < 1 ||
this.selectableDatesMobile.days.length < 1
(includeInshopTimeSlots && this.selectableDatesInshop.days.length < 1) ||
(includeMobileTimeSlots && this.selectableDatesMobile.days.length < 1)
) {
await this.$nextTick();
await this.$refs.datePicker.showAnotherMonth();