Second try to the fix
This commit is contained in:
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user