From 4a1802706868adc6b104502c72f6d2913e31fe39 Mon Sep 17 00:00:00 2001 From: mARTin-B78 Date: Wed, 10 Jun 2026 10:29:45 +0200 Subject: [PATCH] fix: refresh calendar immediately after drag-move of event After dragging a calendar event to a new time or date, trigger fetchCalendarEvents on both the old and new date context so the move is reflected instantly without waiting for the next poll cycle. Applies to both non-recurring and recurring drag confirms. v1.112.2 --- package.json | 2 +- src/components/WeeklyView.tsx | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index b0f28de..342af3f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "my-weekly-todo-list", - "version": "1.112.1", + "version": "1.112.2", "description": "A web-based weekly task management application that organizes to-dos and calendar events in a single, intuitive weekly view", "main": "index.js", "scripts": { diff --git a/src/components/WeeklyView.tsx b/src/components/WeeklyView.tsx index 6f7d789..482713f 100644 --- a/src/components/WeeklyView.tsx +++ b/src/components/WeeklyView.tsx @@ -3187,6 +3187,9 @@ export default function WeeklyView() { ? { ...ev, startTime: eventDragState.originalStartTime, endTime: eventDragState.originalEndTime } : ev )); + } else { + const connId = getConnectionIdForCalendar(eventDragState.calendarId); + fetchCalendarEvents(true, connId); } } catch { setRawCalendarEvents(prev => prev.map(ev => @@ -3206,7 +3209,7 @@ export default function WeeklyView() { document.removeEventListener('mousemove', handleMouseMove); document.removeEventListener('mouseup', handleMouseUp); }; - }, [eventDragState, effectiveCellDuration, calendarEvents]); + }, [eventDragState, effectiveCellDuration, calendarEvents, fetchCalendarEvents, getConnectionIdForCalendar]); // Slot drag-to-create: mousemove + mouseup on document (always active, ref-gated) const effectiveCellDurationRef = useRef(effectiveCellDuration); @@ -3456,6 +3459,9 @@ export default function WeeklyView() { setRawCalendarEvents(prev => prev.map(ev => ev.id === eventId ? { ...ev, startTime: originalStartTime, endTime: originalEndTime } : ev )); + } else { + const connId = getConnectionIdForCalendar(calendarId); + fetchCalendarEvents(true, connId); } } catch { setRawCalendarEvents(prev => prev.map(ev =>