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
chore(calendar): remove automatic fetching on note creation
Elian Doran2a61f51e06ec
diff --git a/apps/client/src/widgets/collections/calendar/index.tsx b/apps/client/src/widgets/collections/calendar/index.tsxindex fd7669646e..103c64d637 100644--- a/apps/client/src/widgets/collections/calendar/index.tsx+++ b/apps/client/src/widgets/collections/calendar/index.tsx@@ -104,12 +104,17 @@ 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(noteIds);+ return async () => await buildEvents(noteIdsRef.current);}return async (e: EventSourceFuncArg) => await buildEventsForCalendar(note, e);- }, [isCalendarRoot, noteIds]);+ }, [isCalendarRoot, note]);const plugins = usePlugins(isEditable, isCalendarRoot);const locale = useLocale();