From 09843ae2cb8fdec7f20ef7720c9dc4e6efeb88b2 Mon Sep 17 00:00:00 2001 From: Scott Kiener Date: Mon, 28 Jul 2025 10:43:54 -0400 Subject: [PATCH] CASH-1159 Remember last in-shop selection if simply toggling between mobile and in-shop --- src/layouts/schedule/schedule.vue | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/layouts/schedule/schedule.vue b/src/layouts/schedule/schedule.vue index 4af1974eb..649c93201 100644 --- a/src/layouts/schedule/schedule.vue +++ b/src/layouts/schedule/schedule.vue @@ -426,6 +426,7 @@ export default { shopProviderData: null, navigatingForward: false, shopListButton: shopListButton, + lastSelectedInshopOrDropoffProvider: null, }; }, async beforeRouteEnter(to, from, next) { @@ -1652,9 +1653,22 @@ export default { handleAppointmentTypeChange(newAppointmentType) { this.updateFooterButtonText(); if (newAppointmentType === AppointmentTypeStrings.MOBILE) { + // Remember last shop selected if previous selection was inshop/dropoff + if ( + (this.appointmentType == AppointmentTypeStrings.IN_SHOP || + AppointmentTypeStrings.DROP_OFF || + AppointmentTypeStrings.IN_SHOP_OR_DROP_OFF) && + this.selectedProvider + ) { + this.lastSelectedInshopOrDropoffProvider = this.selectedProvider; + } this.appointmentType = AppointmentTypeStrings.MOBILE; this.updateSelectedProvider(); } else if (newAppointmentType) { + if (this.appointmentType != AppointmentTypeStrings.MOBILE) { + // Clear last shop selected if appointment type was changed in any manner other than from Mobile + this.lastSelectedInshopOrDropoffProvider = null; + } if (this.selectedTimeSlotInfo?.timeSlot?.routeCode) { // update appointmentType based on routeCode to determine if it should be dropoff or inshop this.appointmentType = this.getInShopOrDropOffApptType( @@ -1665,7 +1679,7 @@ export default { } // make sure a selectedProvider exists - this.updateSelectedProvider(); + this.updateSelectedProvider(this.lastSelectedInshopOrDropoffProvider); } else { this.appointmentType = null; }