mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-06-13 08:15:21 +02:00
fix: compare dirty against correct baseline
This commit is contained in:
parent
00a1a22b74
commit
6606a7f901
1 changed files with 4 additions and 3 deletions
|
|
@ -369,9 +369,10 @@ export const GenericNode = memo(({ data, selected, id, type }: GenericNodeProps)
|
|||
);
|
||||
|
||||
const isDirty = useMemo(() => {
|
||||
const d = data as unknown as Record<string, unknown>;
|
||||
return propertyNames.some((n) => values[n] !== d[n]);
|
||||
}, [values, data, propertyNames]);
|
||||
if (!spec) return false;
|
||||
const baseline = seedValues(data, spec);
|
||||
return propertyNames.some((n) => values[n] !== baseline[n]);
|
||||
}, [values, data, spec, propertyNames]);
|
||||
|
||||
const handleSave = async () => {
|
||||
if (!spec) return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue