Merge pull request #345 from Safelite/feature/digital/SSR-533

Only clearing vaps and supporting items if new vehicle selected
This commit is contained in:
Jason Wheeler 2023-06-15 15:57:50 -04:00 committed by GitHub
commit 3b2237ce74
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 5 deletions

View file

@ -233,7 +233,7 @@ export default {
isSelectedGlassAvailableForVehicle: this.isSelectedGlassAvailableForVehicle,
vehicleInfo:
Object.keys(vehicleInfoToCommit).length === 0
? useMainStore().order.vehicle
? null
: vehicleInfoToCommit,
registrationInfo: {
firstName: this.customerQuestions.firstName,

View file

@ -1158,9 +1158,7 @@ export const useMainStore = defineStore({
registrationInfo?.firstName !== this.order.vehicle.registration?.firstName ||
registrationInfo?.lastName !== this.order.vehicle.registration?.lastName
)
{
this.resetRegistrationAndDependencies();
{
if (!isSelectedGlassAvailableForVehicle) {
this.resetDamageState();
this.resetGlassPartsState();
@ -1170,7 +1168,11 @@ export const useMainStore = defineStore({
this.updateRegistration(registrationInfo);
};
this.updateVehicle(vehicleInfo);
if(vehicleInfo)
{
this.updateVehicle(vehicleInfo);
}
},
saveVin({ isSelectedGlassAvailableForVehicle, vehicleInfo }) {
//Reset dependent state when changing