From efee6aa70aff4c9170acacf1c3dc625f8ef8ffc8 Mon Sep 17 00:00:00 2001 From: AdamCaouetteSafelite Date: Wed, 31 Dec 2025 09:37:39 -0500 Subject: [PATCH] CASH-1315: refactoring from PR review - remove watch --- .../date-picker/date-picker.vue | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/digital-components/date-picker/date-picker.vue b/src/digital-components/date-picker/date-picker.vue index 63449320c..32fe7f5f3 100644 --- a/src/digital-components/date-picker/date-picker.vue +++ b/src/digital-components/date-picker/date-picker.vue @@ -267,7 +267,9 @@ export default { const inshopFirstDate = Array.isArray(this.selectableDatesInshop) ? this.selectableDatesInshop[0]?.date : null; - return (this.isMobileSelected && mobileFirstDate) ? mobileFirstDate + "-mobile" : inshopFirstDate; + return this.isMobileSelected && mobileFirstDate + ? mobileFirstDate + "-mobile" + : inshopFirstDate; }, }, methods: { @@ -540,6 +542,8 @@ export default { } this.months = months; this.isLoading = false; + // if done loading dates, then set to first available date + if (!this.selectedDate) this.selectedDate = this.firstAvailableSelectableDate; if (config.preSelectedDate) { this.$nextTick(() => { @@ -773,6 +777,9 @@ export default { ); this.isLoading = false; + // if done loading dates, then set to first available date + if (!this.selectedDate) this.selectedDate = this.firstAvailableSelectableDate; + this.hideSomeDaysForInitialView = false; // if hid days on initial partial view, this will reveal those days monthToShow.monthClass = monthToShow.monthClass.replace(" month-hidden", ""); this.scrollToElement(monthToShow.monthString); @@ -844,12 +851,6 @@ export default { }, }, watch: { - isLoading(newValue) { - // if done loading dates, then set to first available date - if (newValue === false && this.firstAvailableSelectableDate) { - this.selectedDate = this.firstAvailableSelectableDate; - } - }, modelValue(newValue) { this.resetField({ value: newValue,