diff --git a/src/layouts/vehicle-damage/vehicle-damage.vue b/src/layouts/vehicle-damage/vehicle-damage.vue index 1ebbda421..3b613ad3a 100644 --- a/src/layouts/vehicle-damage/vehicle-damage.vue +++ b/src/layouts/vehicle-damage/vehicle-damage.vue @@ -93,6 +93,7 @@ import replaceOptionsQuestion from "@/layouts/vehicle-damage/replace-options-que import alert from "@/ux-components/alert/alert"; // Supporting files +import { skipVinLookup } from "@/helpers/heritage-integration/navigation-helper"; import { fetchCmsContentForPage } from "@/helpers/cms-content-helper"; import { settleAllPromises } from "@/helpers/layout-helper"; import { storeActions } from "@/constants/store-actions"; @@ -365,7 +366,7 @@ export default { return this.navigateForward(); }, - navigateForward() { + async navigateForward() { const payment = this.$store.getters.payment; const policy = this.$store.getters.policy; @@ -376,17 +377,27 @@ export default { policy.policyNumber !== ""; if (vehicleChangedDuringPolicyLookupInHeritage) { - if (store.getters.damage.isRepair) { + const skipVin = await skipVinLookup(); + + if (skipVin) { this.$router.navigateWithSaving( - this.navigationScenarios.CLICKED_FORWARD_WITH_REPAIR_AND_VERIFIED_INSURANCE, + this.navigationScenarios.CLICKED_FORWARD_WITHOUT_VIN, this.$route ); } else { - this.$router.navigateWithSaving( - this.navigationScenarios - .CLICKED_FORWARD_WITH_REPLACE_AND_VERIFIED_INSURANCE, - this.$route - ); + if (store.getters.damage.isRepair) { + this.$router.navigateWithSaving( + this.navigationScenarios + .CLICKED_FORWARD_WITH_REPAIR_AND_VERIFIED_INSURANCE, + this.$route + ); + } else { + this.$router.navigateWithSaving( + this.navigationScenarios + .CLICKED_FORWARD_WITH_REPLACE_AND_VERIFIED_INSURANCE, + this.$route + ); + } } } // If vin already exists, navigate directly to vin-lookup