Set selecteddate to today when switching layout. Before we were getting the current layout from the store, which would actually be the OLD layout you were switching from 😅 (#8711)
parent
cdba1920fc
commit
ab50067194
|
@ -101,7 +101,7 @@ export const useBookerStore = create<BookerStore>((set, get) => ({
|
|||
setLayout: (layout: BookerLayout) => {
|
||||
// If we switch to a large layout and don't have a date selected yet,
|
||||
// we selected it here, so week title is rendered properly.
|
||||
if (["large_calendar", "large_timeslots"].includes(get().layout) && !get().selectedDate) {
|
||||
if (["large_calendar", "large_timeslots"].includes(layout) && !get().selectedDate) {
|
||||
set({ selectedDate: dayjs().format("YYYY-MM-DD") });
|
||||
}
|
||||
return set({ layout });
|
||||
|
|
Loading…
Reference in New Issue