Merge pull request #2704 from Safelite/feature/revert_CASH-1209

Revert "CASH-1209: Auto select pre-selected timeslot"
This commit is contained in:
Chris 2025-07-28 11:21:43 -04:00 committed by GitHub
commit c49808b476
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -449,6 +449,8 @@ export default {
);
}
this.resetSelectedTimeSlotIfDateChange(timeSlotsForSelectedDate);
return availableTimeSlots;
},
getPremiumAppointmentTimeSlot(timeSlotData) {
@ -547,20 +549,15 @@ export default {
},
resetSelectedTimeSlotIfDateChange(timeSlotsForSelectedDate) {
if (this.selectedRouteCode) {
const selectedRouteCodeString = this.removePremiumFlagFromInput(
this.selectedRouteCode
const selectedRouteCodeString = this.selectedRouteCode.replace(
PREMIUM_TIME_SLOT_ID_FLAG,
""
);
const availableTimeSlotsForSelectedDate =
timeSlotsForSelectedDate.timeSlots || timeSlotsForSelectedDate;
const matchingTimeSlot = availableTimeSlotsForSelectedDate.find((slot) => {
const matchingTimeSlot = timeSlotsForSelectedDate.find((slot) => {
return slot.id === selectedRouteCodeString;
});
if (!matchingTimeSlot) {
if (selectedRouteCodeString !== this.answersForDropOffQuestion[0].value) {
this.resetSelectedTimeSlot();
}
} else {
this.setSelectedTimeSlot();
this.resetSelectedTimeSlot();
}
}
},
@ -584,7 +581,9 @@ export default {
},
selectedDate: {
handler() {
this.resetSelectedTimeSlotIfDateChange(this.timeSlotsForSelectedDate);
this.resetSelectedTimeSlot();
this.selectedAnswerForDropOffOrInshop = null;
this.selectedAnswerForTimeSlots = null;
this.autoSelectTimeSlotIfOnlyOneIsAvailable();
},
},