diff --git a/src/layouts/vehicle/vehicle.vue b/src/layouts/vehicle/vehicle.vue index 282133743..46c6a5b61 100644 --- a/src/layouts/vehicle/vehicle.vue +++ b/src/layouts/vehicle/vehicle.vue @@ -60,7 +60,7 @@ @@ -232,12 +232,14 @@ export default { this.selectedMake = null; this.selectedModel = null; this.selectedStyle = null; + this.carId = null; } } else { this.makeOptions = []; this.selectedMake = null; this.selectedModel = null; this.selectedStyle = null; + this.carId = null; } }, async selectedMake(make) { @@ -248,11 +250,13 @@ export default { else { this.selectedModel = null; this.selectedStyle = null; + this.carId = null; } } else { this.modelOptions = []; this.selectedModel = null; this.selectedStyle = null; + this.carId = null; } }, async selectedModel(model) { @@ -269,10 +273,14 @@ export default { if (sameStyle) { this.getVehicleDetails(); } - } else this.selectedStyle = null; + } else { + this.selectedStyle = null; + this.carId = null; + } } else { this.styleOptions = []; this.selectedStyle = null; + this.carId = null; } }, async selectedStyle(style) { @@ -280,6 +288,7 @@ export default { this.getVehicleDetails(); } else { this.imageUrl = null; + this.carId = null; } }, }, @@ -294,6 +303,15 @@ export default { else if (this.imageUrl == null && this.carId !== null) return false; else return true; }, + allDataRetrieved() { + return ( + !!this.selectedYear && + !!this.selectedMake && + !!this.selectedModel && + !!this.selectedStyle && + !!this.carId + ); + }, }, methods: { getVehicle(year, make, model, style) { diff --git a/src/router/index.js b/src/router/index.js index 7769d8a2d..a20fe828f 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -172,6 +172,8 @@ router.beforeEach(async (to, from, next) => { if (isInIframe && notToPIAReturn) { const newUrl = `${window.top.location.origin}${to.href}`; window.top.location.href = newUrl; + } else if (toQueryPage === fromQueryPage) { + router.go(0); } else { next(); }