diff --git a/src/store/index.js b/src/store/index.js index 6748a4b77..0c9a55c41 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1675,35 +1675,25 @@ export const actions = { context, { year, make, model, style, carId, category, imageUrl, imageVifNumber, imageVifColor } ) { - context.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES); - context.dispatch(storeActions.RESET_REGISTRATION_STATE_AND_DEPENDENCIES); - if ( context.state.order.vehicle.year != year || context.state.order.vehicle.make != make || context.state.order.vehicle.model != model || context.state.order.vehicle.style != style - ) + ) { + context.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES); + context.dispatch(storeActions.RESET_REGISTRATION_STATE_AND_DEPENDENCIES); context.commit(storeMutations.UPDATE_VEHICLE_VIN, null); - - if (context.state.order.vehicle.year != year) { context.commit(storeMutations.UPDATE_YEAR, year); - } - if (context.state.order.vehicle.make != make) { context.commit(storeMutations.UPDATE_MAKE, make); - } - if (context.state.order.vehicle.model != model) { context.commit(storeMutations.UPDATE_MODEL, model); - } - if (context.state.order.vehicle.style != style) { context.commit(storeMutations.UPDATE_STYLE, style); + context.commit(storeMutations.UPDATE_CAR_ID, carId); + context.commit(storeMutations.UPDATE_VEHICLE_CATEGORY, category); + context.commit(storeMutations.UPDATE_VEHICLE_IMAGE_URL, imageUrl); + context.commit(storeMutations.UPDATE_VEHICLE_IMAGE_VIF_NUMBER, imageVifNumber); + context.commit(storeMutations.UPDATE_VEHICLE_IMAGE_COLOR, imageVifColor); } - - context.commit(storeMutations.UPDATE_CAR_ID, carId); - context.commit(storeMutations.UPDATE_VEHICLE_CATEGORY, category); - context.commit(storeMutations.UPDATE_VEHICLE_IMAGE_URL, imageUrl); - context.commit(storeMutations.UPDATE_VEHICLE_IMAGE_VIF_NUMBER, imageVifNumber); - context.commit(storeMutations.UPDATE_VEHICLE_IMAGE_COLOR, imageVifColor); }, saveVehicleDamage(