Second try to the fix

This commit is contained in:
2026-02-18 23:24:10 +02:00
parent ec7e278381
commit a9a1531d57

View File

@@ -380,6 +380,7 @@ export default function DeviceDetail() {
api.get("/mqtt/status").catch(() => null), api.get("/mqtt/status").catch(() => null),
]); ]);
setDevice(d); setDevice(d);
if (d.staffNotes) setStaffNotes(d.staffNotes);
// Match MQTT status by serial number // Match MQTT status by serial number
if (mqttData?.devices && d.device_id) { if (mqttData?.devices && d.device_id) {
@@ -460,11 +461,6 @@ export default function DeviceDetail() {
// ===== Section definitions ===== // ===== Section definitions =====
// Initialize staffNotes from device data once loaded
useEffect(() => {
if (device?.staffNotes) setStaffNotes(device.staffNotes);
}, [device]);
const saveStaffNotes = async (value) => { const saveStaffNotes = async (value) => {
setSavingNotes(true); setSavingNotes(true);
try { try {