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;
}
if (next[item.id] !== item) {
next[item.id] = item;
changed = true;
const existing = next[item.id];
if (existing !== item) {
// 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;
}
}
});