diff --git a/src/layouts/service-location/appointment-type-question/appointment-type-question.vue b/src/layouts/service-location/appointment-type-question/appointment-type-question.vue index 4c1c0d031..cc702529a 100644 --- a/src/layouts/service-location/appointment-type-question/appointment-type-question.vue +++ b/src/layouts/service-location/appointment-type-question/appointment-type-question.vue @@ -34,6 +34,7 @@ export default { isServiceableInshop: Boolean, isServiceableDropoff: Boolean, mobileFeeApplies: Boolean, + zipCode: String, }, computed: { questionText() { @@ -47,6 +48,7 @@ export default { const shouldShowInshop = this.isServiceableInshop; const shouldShowDropoff = this.isServiceableDropoff && !this.$store.getters.damage.isRepair; + const zipCode = this.zipCode; var answers = this.answersFromCms ? this.answersFromCms.filter((answer) => { @@ -87,12 +89,15 @@ export default { watch: { answersToDisplay: { handler(newValue) { - // If there is only one option to display and that option is 'Mobile' then select it - if ( - newValue.length == 1 && - newValue.findIndex((answer) => answer.Name == "Mobile") != -1 - ) { - this.selectedValue = "Mobile"; + // If there is only one option to display and that option is 'Mobile' or 'Inshop' then select it + if (newValue.length == 1) { + const name = newValue[0].Name; + if ( + name === AppointmentTypeStrings.MOBILE || + name === AppointmentTypeStrings.IN_SHOP + ) { + this.selectedValue = name; + } } }, immediate: true, @@ -100,14 +105,14 @@ export default { isMobileOnly: { handler(newValue) { if (newValue) { - this.selectedValue = "Mobile"; + this.selectedValue = AppointmentTypeStrings.MOBILE; } }, }, isInshopOnly: { handler(newValue) { if (newValue) { - this.selectedValue = "Inshop"; + this.selectedValue = AppointmentTypeStrings.IN_SHOP; } }, }, diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index 367211264..b161a6141 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -79,6 +79,7 @@ :isServiceableDropoff="isServiceableDropoff" :isDisplayed="isAppointmentTypeDisplayed" :mobileFeeApplies="mobileFeeApplies" + :zipCode="zipCode" ref="appointmentTypeQuestion" groupName="appointmentTypeQuestion" cmsWidgetName="AppointmentTypeQuestionWidget" diff --git a/src/layouts/service-location/shop-question/shop-question.vue b/src/layouts/service-location/shop-question/shop-question.vue index 76d59be7c..5e85b752b 100644 --- a/src/layouts/service-location/shop-question/shop-question.vue +++ b/src/layouts/service-location/shop-question/shop-question.vue @@ -234,13 +234,9 @@ export default { // nothing to do with this component. We could mitigate this by showing / hiding this component with v-if but that messes // up the component initialization on page load. async handler() { - //We do not need to run this handler in case of Inshop only else it will ended running twice function getNextShopsFromList and will cause pagination - if (!this.isInshopOnly) { - this.resetAnswers(); - - await nextTick(); - this.getNextShopsFromList(); - } + await nextTick(); + this.resetAnswers(); + this.getNextShopsFromList(); }, }, shopProviders: {