diff --git a/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue b/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue index b1b981429..48642101c 100644 --- a/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue +++ b/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue @@ -236,35 +236,40 @@ export default { }); }, async setMobileLocation() { - // Validate the Zip Code - const zipCodeData = await this.getZipCodeData( - this.internalModel.addressQuestions.zipCode - ); + if ( + this.internalModel.addressQuestions.zipCode !== + this.modelValue.addressQuestions.zipCode + ) { + // Validate the Zip Code + const zipCodeData = await this.getZipCodeData( + this.internalModel.addressQuestions.zipCode + ); - if (!zipCodeData.isValid) { - this.displayInvalidZipAlert = true; - this.resetModalButtonStyle(); - } else { - // retrieve mobile fee part - const serviceZipCode = this.internalModel.addressQuestions.zipCode; - const mobileFeePart = await getPricedMobileFeePart(serviceZipCode); + if (!zipCodeData.isValid) { + this.displayInvalidZipAlert = true; + this.resetModalButtonStyle(); + } else { + // retrieve mobile fee part + const serviceZipCode = this.internalModel.addressQuestions.zipCode; + const mobileFeePart = await getPricedMobileFeePart(serviceZipCode); - // retrieve serviceability details - const serviceabilityDetails = await getServiceabilityDetails(serviceZipCode); + // retrieve serviceability details + const serviceabilityDetails = await getServiceabilityDetails(serviceZipCode); - // update content related to service zip code - this.$emit("updated-mobile-fee-part", mobileFeePart); - this.$emit("updated-serviceability", serviceabilityDetails.data); - this.$emit("updated-contains-military-base", zipCodeData.containsMilitaryBase); + // update content related to service zip code + this.$emit("updated-mobile-fee-part", mobileFeePart); + this.$emit("updated-serviceability", serviceabilityDetails.data); + this.$emit("updated-contains-military-base", zipCodeData.containsMilitaryBase); - // Update the page level model - this.$emit("update:modelValue", this.internalModel); + // Update the page level model + this.$emit("update:modelValue", this.internalModel); - if (this.onZipUpdateCallback) { - await this.onZipUpdateCallback(serviceZipCode); + if (this.onZipUpdateCallback) { + await this.onZipUpdateCallback(serviceZipCode); + } + + this.closeModal(); } - - this.closeModal(); } }, },