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): unnecessary start date set when editing a note in quick edit
Elian Doranff31104b9942
diff --git a/apps/client/src/widgets/collections/calendar/index.tsx b/apps/client/src/widgets/collections/calendar/index.tsxindex 4bde4b6350..45a430deaa 100644--- a/apps/client/src/widgets/collections/calendar/index.tsx+++ b/apps/client/src/widgets/collections/calendar/index.tsx@@ -144,7 +144,12 @@ export default function CalendarView({ note, noteIds }: ViewModeProps<CalendarViconst event = api.getEventById(noteId);const note = froca.getNoteFromCache(noteId);if (!event || !note) continue;- event.setProp("title", note.title);+ // Only update the title if it has actually changed.+ // setProp() triggers FullCalendar's eventChange callback, which would+ // re-save the event's dates and cause unwanted side effects.+ if (event.title !== note.title) {+ event.setProp("title", note.title);+ }}});@@ -299,6 +304,11 @@ function useEditing(note: FNote, isEditable: boolean, isCalendarRoot: boolean, c}, [ note, componentId ]);const onEventChange = useCallback(async (e: EventChangeArg) => {+ // Only process actual date/time changes, not other property changes (e.g., title via setProp).+ const datesChanged = e.oldEvent.start?.getTime() !== e.event.start?.getTime()+ || e.oldEvent.end?.getTime() !== e.event.end?.getTime();+ if (!datesChanged) return;+const { startDate, endDate } = parseStartEndDateFromEvent(e.event);if (!startDate) return;