Merge pull request #2679 from Safelite/feature/CASH-1212-refactor

Refactor promises to awaits
This commit is contained in:
chloeherdsafelite 2025-07-22 16:01:36 -04:00 committed by GitHub
commit 3752574fb1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1185,8 +1185,9 @@ export default {
(this.isServiceableInshop && !selectedDateInshop) || (this.isServiceableInshop && !selectedDateInshop) ||
(this.isServiceableDropoff && !selectedDateInshop) (this.isServiceableDropoff && !selectedDateInshop)
) { ) {
this.$nextTick(() => { await this.$nextTick();
this.$refs.datePicker.showAnotherMonth().then((moreSelectableDates) => { await this.$refs.datePicker.showAnotherMonth();
// update all dates // update all dates
// > CHLOE HERD 7/22 -- CASH-1207 // > CHLOE HERD 7/22 -- CASH-1207
@ -1195,24 +1196,16 @@ export default {
// > Doing so will likely add or remove dates, // > Doing so will likely add or remove dates,
// > desyncing the schedule page and the date-picker. // > desyncing the schedule page and the date-picker.
if (!selectedDateInshop) { this.setDisplayWaitList();
selectedDateInshop = this.getSelectedDateForInshop();
}
if (!selectedDateMobile) {
selectedDateMobile = this.getSelectedDateForMobile();
} }
this.setDisplayWaitList(); await this.$nextTick();
});
});
}
this.$nextTick(() => {
if (this.isMobileSelected) { if (this.isMobileSelected) {
this.selectedDate = selectedDateMobile; this.selectedDate = this.getSelectedDateForMobile();
} else { } else {
this.selectedDate = selectedDateInshop; this.selectedDate = this.getSelectedDateForInshop();
} }
});
} }
}, },
getScheduleApiResponse, getScheduleApiResponse,