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; }