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
fix(collections/calendar): events not updating sometimes
Elian Doran1a03c0ca9f7f
diff --git a/apps/client/src/widgets/collections/calendar/index.tsx b/apps/client/src/widgets/collections/calendar/index.tsxindex f7e61a5413..39b9ad6bbf 100644--- a/apps/client/src/widgets/collections/calendar/index.tsx+++ b/apps/client/src/widgets/collections/calendar/index.tsx@@ -117,7 +117,10 @@ export default function CalendarView({ note, noteIds }: ViewModeProps<CalendarViif (loadResults.getNoteIds().some(noteId => noteIds.includes(noteId)) // note title change.|| loadResults.getAttributeRows().some((a) => noteIds.includes(a.noteId ?? ""))) // subnote change.{- calendarRef.current?.refetchEvents();+ // Defer execution after the load results are processed so that the event builder has the updated data to work with.+ setTimeout(() => {+ calendarRef.current?.refetchEvents();+ }, 0);}});