Revert "CASH-1209: Auto select pre-selected timeslot"

This reverts commit f5d4da065c.
This commit is contained in:
Chris Redelinghuys 2025-07-28 11:15:51 -04:00
parent 0e6609d980
commit 462ebd6519

View file

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