From eb6f38a6676dd62d63fe6d60c9ded06732919fb1 Mon Sep 17 00:00:00 2001 From: Jason Wheeler Date: Thu, 15 Jun 2023 15:46:49 -0400 Subject: [PATCH] Only clearing vaps and supporting items if new vehicle selected --- src/layouts/address-lookup/address-lookup.vue | 2 +- src/store/index.js | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/layouts/address-lookup/address-lookup.vue b/src/layouts/address-lookup/address-lookup.vue index 40d3bd92..bb58ee99 100644 --- a/src/layouts/address-lookup/address-lookup.vue +++ b/src/layouts/address-lookup/address-lookup.vue @@ -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, diff --git a/src/store/index.js b/src/store/index.js index 1a300bcb..535bf224 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -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