diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index d8167ad57..2b166e830 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -20,10 +20,8 @@ alertClass="alert-warning" /> answer.Name == "Mobile"); - } else if (this.serviceability == "InshopOnly") { + } else if (this.isServiceableInshop) { filteredAnswers = this.answersFromCms.filter( (answer) => answer.Name == "Inshop" || answer.Name == "DropOff" ); - } else if (this.serviceability == "None") { + } else { filteredAnswers = []; } return filteredAnswers; }, - serviceability() { - let mobileAvailable; - if (this.IsRecalibrationServiceableMobile == null) { - mobileAvailable = this.isGlassServiceableMobile; - } else { - mobileAvailable = - this.isGlassServiceableMobile && this.isRecalibrationServiceableMobile; - } - - const inshopAvailable = - this.isGlassServiceableInshop && this.isRecalibrationServiceableInshop; - - let result; - if (inshopAvailable && mobileAvailable) { - result = "All"; - } else if (inshopAvailable && !mobileAvailable) { - result = "InshopOnly"; - } else if (!inshopAvailable && mobileAvailable) { - result = "MobileOnly"; - } else if (!inshopAvailable && !mobileAvailable) { - result = "None"; - } - - return result; - }, selectedValues: { get: function () { return this.modelValue; @@ -87,11 +60,14 @@ export default { this.$emit("update:modelValue", newValue); }, }, + isMobileOnly() { + return this.isServiceableMobile && !this.isServiceableInshop; + }, }, watch: { - serviceability: { + isMobileOnly: { handler(newValue) { - if (newValue == "MobileOnly") { + if (newValue) { this.selectedValues = "Mobile"; } else { this.selectedValues = null;