diff --git a/src/router/index.js b/src/router/index.js index 94c3dbe9b..f93b08ee6 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -128,50 +128,39 @@ const routes = [ (leadGenDamage.toUpperCase() != "WINDSHIELDREPAIR" || leadGenNumberOfChips?.length > 0) ) { - if (!store.getters.applicationUser.triggeredSiteEntry) { - store.commit(storeMutations.UPDATE_IS_LEAD_GEN, true); - store.commit(storeMutations.UPDATE_LEAD_GEN_YEAR, leadGenYear); - store.commit(storeMutations.UPDATE_LEAD_GEN_MAKE, leadGenMake); - store.commit(storeMutations.UPDATE_LEAD_GEN_MODEL, leadGenModel); - store.commit(storeMutations.UPDATE_LEAD_GEN_STYLE, leadGenStyle); + store.commit(storeMutations.UPDATE_IS_LEAD_GEN, true); + store.commit(storeMutations.UPDATE_LEAD_GEN_YEAR, leadGenYear); + store.commit(storeMutations.UPDATE_LEAD_GEN_MAKE, leadGenMake); + store.commit(storeMutations.UPDATE_LEAD_GEN_MODEL, leadGenModel); + store.commit(storeMutations.UPDATE_LEAD_GEN_STYLE, leadGenStyle); + store.commit(storeMutations.UPDATE_LEAD_GEN_DAMAGE_TYPE, leadGenDamage); + if (leadGenDamage.toUpperCase() == "WINDSHIELDREPLACE") { + store.commit(storeMutations.UPDATE_LEAD_GEN_IS_REPAIR, false); + store.commit(storeMutations.UPDATE_LEAD_GEN_NUMBER_OF_CHIPS, null); + } else if (leadGenDamage.toUpperCase() == "WINDSHIELDREPAIR") { + store.commit(storeMutations.UPDATE_LEAD_GEN_IS_REPAIR, true); store.commit( - storeMutations.UPDATE_LEAD_GEN_DAMAGE_TYPE, - leadGenDamage + storeMutations.UPDATE_LEAD_GEN_NUMBER_OF_CHIPS, + leadGenNumberOfChips ); - if (leadGenDamage.toUpperCase() == "WINDSHIELDREPLACE") { - store.commit(storeMutations.UPDATE_LEAD_GEN_IS_REPAIR, false); - store.commit( - storeMutations.UPDATE_LEAD_GEN_NUMBER_OF_CHIPS, - null - ); - } else if (leadGenDamage.toUpperCase() == "WINDSHIELDREPAIR") { - store.commit(storeMutations.UPDATE_LEAD_GEN_IS_REPAIR, true); - store.commit( - storeMutations.UPDATE_LEAD_GEN_NUMBER_OF_CHIPS, - leadGenNumberOfChips - ); - } + } + store.commit(storeMutations.UPDATE_LEAD_GEN_ZIP_CODE, leadGenZipCode); + store.commit( + storeMutations.UPDATE_LEAD_GEN_EMAIL_ADDRESS, + leadGenEmail + ); + if (leadGenIsInsurance == "true") { + store.commit(storeMutations.UPDATE_LEAD_GEN_IS_INSURANCE, true); store.commit( - storeMutations.UPDATE_LEAD_GEN_ZIP_CODE, - leadGenZipCode + storeMutations.UPDATE_LEAD_GEN_SERVICE_PACKAGE, + leadGenServicePackage ); + } + if (leadGenDamage.toUpperCase() != "WINDSHIELDREPAIR") { store.commit( - storeMutations.UPDATE_LEAD_GEN_EMAIL_ADDRESS, - leadGenEmail + storeMutations.UPDATE_LEAD_GEN_VIN_SELECTION, + leadGenVinSelection ); - if (leadGenIsInsurance == "true") { - store.commit(storeMutations.UPDATE_LEAD_GEN_IS_INSURANCE, true); - store.commit( - storeMutations.UPDATE_LEAD_GEN_SERVICE_PACKAGE, - leadGenServicePackage - ); - } - if (leadGenDamage.toUpperCase() != "WINDSHIELDREPAIR") { - store.commit( - storeMutations.UPDATE_LEAD_GEN_VIN_SELECTION, - leadGenVinSelection - ); - } } }