fix: booker atom month reset (#14732)

This commit is contained in:
Lauris Skraucis
2024-04-24 14:36:29 +00:00
committed by GitHub
parent 82fcda4b42
commit a7bd4aee85
@@ -209,6 +209,10 @@ export const useBookerStore = create<BookerStore>((set, get) => ({
},
month: getQueryParam("month") || getQueryParam("date") || dayjs().format("YYYY-MM"),
setMonth: (month: string | null) => {
if (!month) {
removeQueryParam("month");
return;
}
set({ month, selectedTimeslot: null });
updateQueryParam("month", month ?? "");
get().setSelectedDate(null);