CSR-347: return out of forwardButtonAction if no lookupVin found / remove unused var

This commit is contained in:
Adam Caouette 2022-06-01 08:26:30 -04:00
parent 47a3f97c61
commit 855e3acc9d

View file

@ -162,8 +162,10 @@ export default {
async forwardButtonAction() {
const vinLookup = await this.lookupVin(this.selectedVehicle.vin).catch(() => {
this.$refs.funnelFooter.removeLoader();
return;
});
if (!vinLookup) {
return;
}
this.isSelectedGlassAvailableForVehicle = await isGlassAvailableForCarId(vinLookup.data.carId);
this.updateCustomerInfo(this.selectedVehicle.vin, this.selectedVehicle.vehicle);
this.navigateForward();
@ -210,7 +212,7 @@ export default {
},
watch: {
selectedVehicleVin(vehicleVin) {
selectedVehicleVin() {
// does this vehicle match the previously selected carId?
this.isCarIdDifferent = this.selectedVehicle.vehicle.carId !== store.getters.vehicle.carId;
this.$refs.funnelFooter.updateButtonText(`Continue with ${this.selectedVehicle.vehicle.year} ${this.selectedVehicle.vehicle.make} ${this.selectedVehicle.vehicle.model}`);