diff --git a/src/layouts/policy-vehicles/policy-vehicles.vue b/src/layouts/policy-vehicles/policy-vehicles.vue index 82ab834f..f38516f6 100644 --- a/src/layouts/policy-vehicles/policy-vehicles.vue +++ b/src/layouts/policy-vehicles/policy-vehicles.vue @@ -56,8 +56,7 @@ export default { } }, mounted() { - // clear previously selected vehicle so that the blurred vehicle image displays on page entry - useMainStore().resetVehicleState(); + this.autoSelectIfOneVehicle(); }, async beforeRouteEnter(to, from, next) { @@ -127,8 +126,12 @@ export default { }, }; } - }, - + }, + autoSelectIfOneVehicle() { + if (this.VehiclesFromApi.length == 1) { + this.selectedVehicleVin = this.VehiclesFromApi[0].vin; + } + } }, computed:{ VehiclesForQuestions() { @@ -165,7 +168,7 @@ export default { } else { - // get vehicle details from selected vin + // get vehicle details from selected VIN const vehicle = await this.lookupVehicleByVin(value); // handle error in case vehicle info doesn't come back for selected VIN @@ -177,7 +180,8 @@ export default { // save selected vehicle to the store this.mainStore.updateVehicle(vehicle.data); this.displayGeneric = true; - + + // get the style(s) associated with the selected YMM const styleOptions = await this.mainStore.getVehicleStyles( vehicle.data.year, vehicle.data.make,