From 39436c533d70eab34d334e15380a4be60c606e75 Mon Sep 17 00:00:00 2001 From: CarlNation <32103961+CarlNation@users.noreply.github.com> Date: Wed, 30 Aug 2023 08:38:49 -0400 Subject: [PATCH 1/2] CSR-1559 No need to reset customer name if they've changed their address. Use vin change instead of name to trigger reset. --- src/store/index.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/store/index.js b/src/store/index.js index e67eb7414..4a3282e1f 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -336,8 +336,6 @@ export const mutations = { }, resetRegistrationState(state) { state.order.vehicle.registration.licensePlate = null; - state.order.customer.firstName = null; - state.order.customer.lastName = null; }, resetGlassPartsState(state) { state.order.lineItems.glassParts = null; @@ -1676,8 +1674,7 @@ export const actions = { ) { //Reset dependent state when changing if ( - registrationInfo?.firstName !== context.state.order.customer?.firstName || - registrationInfo?.lastName !== context.state.order.customer?.lastName + vehicleInfo.vin !== context.state.order.vehicle.vin ) { context.dispatch(storeActions.RESET_REGISTRATION_STATE_AND_DEPENDENCIES); From 2f5d348bbac58ab4091a5351ef602edf62c01202 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Wed, 30 Aug 2023 08:43:14 -0400 Subject: [PATCH 2/2] CSR-1559 prettier --- src/store/index.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/store/index.js b/src/store/index.js index 4a3282e1f..cc8dc0b39 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1673,9 +1673,7 @@ export const actions = { { isSelectedGlassAvailableForVehicle, vehicleInfo, registrationInfo } ) { //Reset dependent state when changing - if ( - vehicleInfo.vin !== context.state.order.vehicle.vin - ) { + if (vehicleInfo.vin !== context.state.order.vehicle.vin) { context.dispatch(storeActions.RESET_REGISTRATION_STATE_AND_DEPENDENCIES); if (!isSelectedGlassAvailableForVehicle) {