Merge pull request #2703 from Safelite/feature/CASH-1159-skiener

CASH-1159
This commit is contained in:
scottkiener-at-safelite 2025-07-28 11:03:41 -04:00 committed by GitHub
commit 0e6609d980
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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