fix: check deep equality

This commit is contained in:
ValdiANS
2026-04-07 11:53:34 +07:00
parent dd5bbf0ac6
commit 981b48acc0
@@ -974,9 +974,17 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
return; return;
} }
if (next[item.id] !== item) { const existing = next[item.id];
next[item.id] = item; if (existing !== item) {
changed = true; // Check deep equality to avoid triggering state changes
// when identical data comes from different sources (e.g. initialValues vs SWR)
if (
!existing ||
JSON.stringify(existing) !== JSON.stringify(item)
) {
next[item.id] = item;
changed = true;
}
} }
}); });