From c282e3bfca1e4f84bb270ec05a23d118fbd11962 Mon Sep 17 00:00:00 2001 From: Kroell Date: Mon, 13 Mar 2023 15:03:40 -0400 Subject: [PATCH] changes to ensure vin is saved if moving backward through flow and restarting vin lookup --- src/store/index.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/store/index.js b/src/store/index.js index 711d736f..4b6ac5b6 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -341,6 +341,7 @@ export const useMainStore = defineStore({ // PartsOrQuestions API Actions async getPartsOrQuestions() { + this.resetGlassPartsState(); const vehicle = this.vehicle; const damage = this.damage; const order = this.order; @@ -996,9 +997,10 @@ export const useMainStore = defineStore({ } //Save new values - this.updateVehicle(vehicleInfo); this.updateRegistration(registrationInfo); - } + }; + + this.updateVehicle(vehicleInfo); }, saveVin({ isSelectedGlassAvailableForVehicle, vehicleInfo }) { //Reset dependent state when changing @@ -1031,9 +1033,10 @@ export const useMainStore = defineStore({ //Save new values this.updateVehicle(vehicleInfo); - this.updateRegistration(registrationInfo); - } - }, + } + + this.updateRegistration(registrationInfo); + }, resetRegistrationAndDependencies() { this.resetRegistrationState();