fix: refresh calendar immediately after drag-move of event
Some checks failed
Playwright Tests / test (push) Has been cancelled
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:
parent
4f140baa38
commit
4a18027068
@ -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": {
|
||||
|
||||
@ -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 =>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user