Skip to content

Commit

Permalink
fix: overlay calendar view for Booker atom (#16642)
Browse files Browse the repository at this point in the history
* overlay calendar needs to be false when in month_view

* fixup
  • Loading branch information
Ryukemeister authored Sep 16, 2024
1 parent 32b2e83 commit 071c899
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/platform/atoms/booker/BookerPlatformWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -381,15 +381,17 @@ export const BookerPlatformWrapper = (
});
setBookingData(null);
}
if (isOverlayCalendarEnabled) {
localStorage.setItem("overlayCalendarSwitchDefault", "true");
} else {
localStorage.removeItem("overlayCalendarSwitchDefault");
}
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

useEffect(() => {
if (isOverlayCalendarEnabled && view === "MONTH_VIEW") {
localStorage.removeItem("overlayCalendarSwitchDefault");
}
setIsOverlayCalendarEnabled(Boolean(localStorage?.getItem?.("overlayCalendarSwitchDefault")));
}, [view, isOverlayCalendarEnabled]);

return (
<AtomsWrapper>
<BookerComponent
Expand Down

0 comments on commit 071c899

Please sign in to comment.