From 462ebd651974d18abfd1a531ae9d0ec5ebe29f0a Mon Sep 17 00:00:00 2001 From: Chris Redelinghuys Date: Mon, 28 Jul 2025 11:15:51 -0400 Subject: [PATCH] Revert "CASH-1209: Auto select pre-selected timeslot" This reverts commit f5d4da065c097d1a4c81d187d7e87d39c436d9c8. --- .../time-slot-question/time-slot-question.vue | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/layouts/schedule/time-slot-question/time-slot-question.vue b/src/layouts/schedule/time-slot-question/time-slot-question.vue index 661d54751..d6e4cf721 100644 --- a/src/layouts/schedule/time-slot-question/time-slot-question.vue +++ b/src/layouts/schedule/time-slot-question/time-slot-question.vue @@ -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(); }, },