Merge pull request #2681 from Safelite/feature/CASH-1214

Feature/CASH-1214
This commit is contained in:
Chris 2025-07-23 14:10:47 -04:00 committed by GitHub
commit 9250908724
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -183,6 +183,7 @@ export default {
let appointmentTypeCmsWidgetName; let appointmentTypeCmsWidgetName;
if ( if (
this.selectedDate == null ||
this.appointmentType === AppointmentTypeStrings.IN_SHOP_OR_DROP_OFF || this.appointmentType === AppointmentTypeStrings.IN_SHOP_OR_DROP_OFF ||
this.appointmentType === AppointmentTypeStrings.IN_SHOP || this.appointmentType === AppointmentTypeStrings.IN_SHOP ||
this.appointmentType === AppointmentTypeStrings.DROP_OFF this.appointmentType === AppointmentTypeStrings.DROP_OFF
@ -440,6 +441,8 @@ export default {
); );
} }
this.resetSelectedTimeSlotIfDateChange(timeSlotsForSelectedDate);
return availableTimeSlots; return availableTimeSlots;
}, },
getPremiumAppointmentTimeSlot(timeSlotData) { getPremiumAppointmentTimeSlot(timeSlotData) {
@ -535,6 +538,20 @@ export default {
successMessageElement.scrollIntoView({ behavior: "smooth" }); successMessageElement.scrollIntoView({ behavior: "smooth" });
} }
}, },
resetSelectedTimeSlotIfDateChange(timeSlotsForSelectedDate) {
if (this.selectedRouteCode) {
const selectedRouteCodeString = this.selectedRouteCode.replace(
PREMIUM_TIME_SLOT_ID_FLAG,
""
);
const matchingTimeSlot = timeSlotsForSelectedDate.find((slot) => {
return slot.id === selectedRouteCodeString;
});
if (!matchingTimeSlot) {
this.selectedRouteCode = null;
}
}
},
}, },
watch: { watch: {
waitListRequested(newVal) { waitListRequested(newVal) {