Only clearing vaps and supporting items if new vehicle selected
This commit is contained in:
parent
821f7eebcb
commit
eb6f38a667
2 changed files with 7 additions and 5 deletions
|
|
@ -233,7 +233,7 @@ export default {
|
||||||
isSelectedGlassAvailableForVehicle: this.isSelectedGlassAvailableForVehicle,
|
isSelectedGlassAvailableForVehicle: this.isSelectedGlassAvailableForVehicle,
|
||||||
vehicleInfo:
|
vehicleInfo:
|
||||||
Object.keys(vehicleInfoToCommit).length === 0
|
Object.keys(vehicleInfoToCommit).length === 0
|
||||||
? useMainStore().order.vehicle
|
? null
|
||||||
: vehicleInfoToCommit,
|
: vehicleInfoToCommit,
|
||||||
registrationInfo: {
|
registrationInfo: {
|
||||||
firstName: this.customerQuestions.firstName,
|
firstName: this.customerQuestions.firstName,
|
||||||
|
|
|
||||||
|
|
@ -1158,9 +1158,7 @@ export const useMainStore = defineStore({
|
||||||
registrationInfo?.firstName !== this.order.vehicle.registration?.firstName ||
|
registrationInfo?.firstName !== this.order.vehicle.registration?.firstName ||
|
||||||
registrationInfo?.lastName !== this.order.vehicle.registration?.lastName
|
registrationInfo?.lastName !== this.order.vehicle.registration?.lastName
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
this.resetRegistrationAndDependencies();
|
|
||||||
|
|
||||||
if (!isSelectedGlassAvailableForVehicle) {
|
if (!isSelectedGlassAvailableForVehicle) {
|
||||||
this.resetDamageState();
|
this.resetDamageState();
|
||||||
this.resetGlassPartsState();
|
this.resetGlassPartsState();
|
||||||
|
|
@ -1170,7 +1168,11 @@ export const useMainStore = defineStore({
|
||||||
this.updateRegistration(registrationInfo);
|
this.updateRegistration(registrationInfo);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.updateVehicle(vehicleInfo);
|
if(vehicleInfo)
|
||||||
|
{
|
||||||
|
this.updateVehicle(vehicleInfo);
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
saveVin({ isSelectedGlassAvailableForVehicle, vehicleInfo }) {
|
saveVin({ isSelectedGlassAvailableForVehicle, vehicleInfo }) {
|
||||||
//Reset dependent state when changing
|
//Reset dependent state when changing
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue