diff --git a/src/layouts/service-location/shop-question/shop-question-popup.vue b/src/layouts/service-location/shop-question/shop-question-popup.vue index 914721408..a319910e0 100644 --- a/src/layouts/service-location/shop-question/shop-question-popup.vue +++ b/src/layouts/service-location/shop-question/shop-question-popup.vue @@ -108,7 +108,6 @@ export default { numberOfShopsToDisplay: 0, localShopProviderData: this.shopProviderDataFromParent, localSelectedProviderNumber: null, - displayInvalidZipAlert: false, // part of big refactor of asyn calls displayNoShopsAlert: false, // part of big refactor of asyn calls zipCodeData: null, }; @@ -137,6 +136,9 @@ export default { showMoreShopsLinkText() { return this.getCmsContent("ShowMoreShopsLinkWidget", "Text"); }, + displayInvalidZipAlert() { + return this.zipCodeData && !this.zipCodeData.isValid; + }, modal() { return this.$refs.shopQuestionModal; }, @@ -251,9 +253,7 @@ export default { this.zipCodeData = await this.getZipCodeData(this.localZipCode, "service-location"); // Add zipCode to zipCodeData as it does not come back from endpoint this.zipCodeData.zipCode = this.localZipCode; - if (!this.zipCodeData.isValid) { - this.displayInvalidZipAlert = true; // Think we can remove once done refactoring save method - } else { + if (this.zipCodeData.isValid) { if (this.isVehicleHeavyTruck) { // check the location endpoint to verify this zip can service a heavy truck const closestShops = await getClosestApplicableShops( @@ -293,7 +293,6 @@ export default { this.displayNoShopsAlert = this.answers.length === 0; }, resetAlerts() { - this.displayInvalidZipAlert = false; this.displayNoServiceAlert = false; this.displayNoShopsAlert = false; },