fix: refresh calendar immediately after drag-move of event
Some checks failed
Playwright Tests / test (push) Has been cancelled

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
This commit is contained in:
mARTin-B78 2026-06-10 10:29:45 +02:00
parent 4f140baa38
commit 4a18027068
2 changed files with 8 additions and 2 deletions

View File

@ -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": {

View File

@ -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 =>