diff --git a/src/digital-components/date-picker/date-picker.vue b/src/digital-components/date-picker/date-picker.vue index aa685e88..6bdf1c77 100644 --- a/src/digital-components/date-picker/date-picker.vue +++ b/src/digital-components/date-picker/date-picker.vue @@ -461,11 +461,11 @@ export default { daysFromStart: null }; }, - gotoNextPage() { + async gotoNextPage() { const maxPageIndex = Math.floor((this.daysLoaded - 1) / this.daysToAdd); if (this.activePageIndex >= maxPageIndex) { // do not go to next page right away if at end of loaded days - this.loadMoreDays(maxPageIndex, this.daysToAdd, this.initialDaysToLoad).then(() => { + await this.loadMoreDays(maxPageIndex, this.daysToAdd, this.initialDaysToLoad).then(() => { this.daysLoaded += this.initialDaysToLoad; this.activePageIndex += 1; this.selectedDate = null; @@ -625,6 +625,8 @@ export default { }); }, async setCalendarData(config = {}) { + const initialMql = window.matchMedia('(min-width: 1200px)'); + this.isMobileView = !initialMql.matches; config.initialShopTimeSlotsResponse.days.forEach((selectableDate) => { const dateObjectToPush = { date: selectableDate.date,