Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
Revert "chore(calendar): remove automatic fetching on note creation"
Elian Doran2eae8bbb6447
diff --git a/apps/client/src/widgets/collections/calendar/index.tsx b/apps/client/src/widgets/collections/calendar/index.tsxindex 103c64d637..fd7669646e 100644--- a/apps/client/src/widgets/collections/calendar/index.tsx+++ b/apps/client/src/widgets/collections/calendar/index.tsx@@ -104,17 +104,12 @@ export default function CalendarView({ note, noteIds }: ViewModeProps<CalendarViuseResizeObserver(containerRef, () => calendarRef.current?.updateSize());const isCalendarRoot = (calendarRoot || workspaceCalendarRoot);const isEditable = !isCalendarRoot;- const noteIdsRef = useRef(noteIds);- useEffect(() => {- noteIdsRef.current = noteIds;- }, [ noteIds ]);-const eventBuilder = useMemo(() => {if (!isCalendarRoot) {- return async () => await buildEvents(noteIdsRef.current);+ return async () => await buildEvents(noteIds);}return async (e: EventSourceFuncArg) => await buildEventsForCalendar(note, e);- }, [isCalendarRoot, note]);+ }, [isCalendarRoot, noteIds]);const plugins = usePlugins(isEditable, isCalendarRoot);const locale = useLocale();