CASH-1159

CASH-1159 fixed selected shop from not persisting when switching from mobile back to inshop
This commit is contained in:
Johnny shultz 2025-07-25 09:10:35 -04:00
parent cd1d3d9d48
commit 4ed29efa3b

View file

@ -425,6 +425,7 @@ export default {
shopProviderData: null,
navigatingForward: false,
shopListButton: shopListButton,
lastInshopProvider: this.getSelectedProviderFromStore() || null,
};
},
async beforeRouteEnter(to, from, next) {
@ -1116,6 +1117,13 @@ export default {
} else {
this.updateSelectedProvider(selectedProvider);
}
if (
this.appointmentType === this.appointmentTypeStrings.IN_SHOP ||
this.appointmentType === this.appointmentTypeStrings.DROP_OFF ||
this.appointmentType === this.appointmentTypeStrings.IN_SHOP_OR_DROP_OFF
) {
this.lastInshopProvider = this.selectedProvider;
}
},
async getMoreScheduleData(startDate, endDate) {
// called only when "View more dates" is clicked; not on initial page load
@ -1605,9 +1613,13 @@ export default {
},
};
} else if (
!this.selectedProvider?.address?.streetAddress &&
this.shopProviderData?.shopProviders?.length
(this.appointmentType === this.appointmentTypeStrings.IN_SHOP ||
this.appointmentType === this.appointmentTypeStrings.DROP_OFF ||
this.appointmentType === this.appointmentTypeStrings.IN_SHOP_OR_DROP_OFF) &&
this.lastInshopProvider.address.city
) {
this.selectedProvider = this.lastInshopProvider;
} else {
this.selectedProvider = this.shopProviderData.shopProviders[0];
}
},