From 64e91ca4f3cde82587e8f5a5da748792ef09eecc Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Tue, 22 Jul 2025 15:51:05 -0400 Subject: [PATCH] Refactor promises to awaits --- src/layouts/schedule/schedule.vue | 41 +++++++++++++------------------ 1 file changed, 17 insertions(+), 24 deletions(-) diff --git a/src/layouts/schedule/schedule.vue b/src/layouts/schedule/schedule.vue index ab9e08177..bddbb335a 100644 --- a/src/layouts/schedule/schedule.vue +++ b/src/layouts/schedule/schedule.vue @@ -1185,34 +1185,27 @@ export default { (this.isServiceableInshop && !selectedDateInshop) || (this.isServiceableDropoff && !selectedDateInshop) ) { - this.$nextTick(() => { - this.$refs.datePicker.showAnotherMonth().then((moreSelectableDates) => { - // update all dates + await this.$nextTick(); + await this.$refs.datePicker.showAnotherMonth(); - // > CHLOE HERD 7/22 -- CASH-1207 - // > Do not update the available dates again here; - // > they have already been updated by `showAnotherMonth`. - // > Doing so will likely add or remove dates, - // > desyncing the schedule page and the date-picker. + // update all dates - if (!selectedDateInshop) { - selectedDateInshop = this.getSelectedDateForInshop(); - } - if (!selectedDateMobile) { - selectedDateMobile = this.getSelectedDateForMobile(); - } + // > CHLOE HERD 7/22 -- CASH-1207 + // > Do not update the available dates again here; + // > they have already been updated by `showAnotherMonth`. + // > Doing so will likely add or remove dates, + // > desyncing the schedule page and the date-picker. - this.setDisplayWaitList(); - }); - }); + this.setDisplayWaitList(); + } + + await this.$nextTick(); + + if (this.isMobileSelected) { + this.selectedDate = this.getSelectedDateForMobile(); + } else { + this.selectedDate = this.getSelectedDateForInshop(); } - this.$nextTick(() => { - if (this.isMobileSelected) { - this.selectedDate = selectedDateMobile; - } else { - this.selectedDate = selectedDateInshop; - } - }); } }, getScheduleApiResponse,