diff --git a/apps/client/src/widgets/collections/calendar/index.tsx b/apps/client/src/widgets/collections/calendar/index.tsx index 8126c2808..317382593 100644 --- a/apps/client/src/widgets/collections/calendar/index.tsx +++ b/apps/client/src/widgets/collections/calendar/index.tsx @@ -145,16 +145,12 @@ export default function CalendarView({ note, noteIds }: ViewModeProps }) { - const currentViewType = calendarRef.current?.view?.type; + const { title, viewType: currentViewType } = useOnDatesSet(calendarRef); const currentViewData = CALENDAR_VIEWS.find(v => calendarRef.current && v.type === currentViewType); - // Wait for the calendar ref to become available. - const [ ready, setReady ] = useState(false); - useEffect(() => setReady(true), []); - - return (ready && + return (
- {calendarRef.current?.view.title} + {title} {CALENDAR_VIEWS.map(viewData => (