fix(planner): a refresh of the trip no longer wipes an open transport or booking form

The transport form re-seeded itself whenever the trip's costs arrived as a
new array, and the booking form whenever days, places or stays did. A
socket reconnect re-reads the whole trip, so behind a proxy that drops idle
sockets every 15 to 30 seconds everything typed so far was wiped. Both forms
now re-seed only for what opens a different form; the data is read when the
form is seeded, as before.

Fixes #3069
This commit is contained in:
Maurice
2026-11-12 15:39:20 +01:00
parent 80130f7946
commit ac7094df05
4 changed files with 39 additions and 4 deletions
@@ -132,8 +132,12 @@ export function ReservationModal({ isOpen, onClose, onSave, reservation, days, p
setForm({ ...EMPTY_FORM, assignment_id: defaultAssignmentId ?? '' })
setPendingFiles([])
}
// Keyed only on what opens a different form. Days, places and stays are read
// when the form is seeded; a refresh of the trip while the dialog is open (a
// socket reconnect re-reads it) hands in new arrays of the same data and must
// not reseed it and wipe what the user is typing (#3069).
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [reservation, prefill, isOpen, selectedDayId, defaultAssignmentId, days, places, accommodations])
}, [reservation, prefill, isOpen, selectedDayId, defaultAssignmentId])
const handleSubmit = async (e?: { preventDefault?: () => void }) => {
e?.preventDefault?.()