Skip to content

Build your personal knowledge base with Trilium Notes

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.tsx
index 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<CalendarVi
if (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);
}
});