refactor
This commit is contained in:
parent
33a617ea25
commit
fd1f630677
1 changed files with 15 additions and 17 deletions
|
|
@ -194,24 +194,22 @@ export default {
|
|||
|
||||
// handle error in case vehicle info doesn't come back for selected VIN
|
||||
if (vehicle?.error === true) {
|
||||
this.mainStore.resetVehicleState();
|
||||
this.displayGeneric = true;
|
||||
return;
|
||||
this.mainStore.resetVehicleState();
|
||||
this.displayGeneric = true;
|
||||
} else {
|
||||
// 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,
|
||||
vehicle.data.model,
|
||||
);
|
||||
// if there is more than 1 style for the selected vehicle, display generic/blurred image
|
||||
this.displayGeneric = styleOptions?.data?.length > 1;
|
||||
}
|
||||
|
||||
// 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,
|
||||
vehicle?.data.model
|
||||
)
|
||||
|
||||
// if there is more than 1 style for the selected vehicle, display generic/blurred image
|
||||
this.displayGeneric = styleOptions?.data?.length > 1;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue