From 260448886faeaf1c5fad5e9d7de53cee0869b2aa Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Thu, 11 Dec 2025 12:38:19 -0500 Subject: [PATCH] CASH-1790: refactoring and restoring watch on time-slot-question (cherry picked from commit 290ea914e2d8fed5d26e2dd2dbc85915b2b6c53d) --- src/layouts/schedule/schedule.vue | 13 ++----------- .../time-slot-question/time-slot-question.vue | 5 +++++ 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/layouts/schedule/schedule.vue b/src/layouts/schedule/schedule.vue index dd0397da2..bcf138387 100644 --- a/src/layouts/schedule/schedule.vue +++ b/src/layouts/schedule/schedule.vue @@ -1200,8 +1200,6 @@ export default { async initializeDatePicker() { this.isShowMobileFirstAppt && this.showLoadingModal(); - this.selectedDate = null; - const includeMobileTimeSlots = this.isServiceableMobile; const includeInshopTimeSlots = this.isServiceableInshop || this.isServiceableDropoff; const datePickerInitialData = await this.$refs.datePicker.loadInitialData({ @@ -1594,10 +1592,8 @@ export default { // check if date actually changed if (previousDate !== date.dateString) { - this.handleDateChanged({ - newDate: date.dateString, - oldDate: previousDate, - }); + this.selectedTimeSlotInfo = this.getEmptyTimeSlot(); + this.updateFooterButtonText(this.selectedTimeSlotInfo); } // TODO: REMOVE AS PART OF CASH-1634 @@ -1608,11 +1604,6 @@ export default { // this.includePricingByDayUpcharge = false; // } }, - handleDateChanged(newDate) { - // Clear time slot selection when date changes - this.selectedTimeSlotInfo = this.getEmptyTimeSlot(); - this.updateFooterButtonText(this.selectedTimeSlotInfo); - }, getEmptyTimeSlot() { return { timeSlot: { 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 3a148972b..1b8a2cb2e 100644 --- a/src/layouts/schedule/time-slot-question/time-slot-question.vue +++ b/src/layouts/schedule/time-slot-question/time-slot-question.vue @@ -185,6 +185,11 @@ export default { selectedRouteCodeData(newValue) { this.updateDropoffAndTimeSlotAnswersFromSelectedRouteCodeData(newValue); }, + timeSlotsForSelectedDate() { + this.selectedAnswerForDropOffOrInshop = null; + this.selectedAnswerForTimeSlots = null; + this.autoSelectTimeSlotIfOnlyOneIsAvailable(); + }, }, computed: { supplementalInformationBlock() {