fix(frontend): Fix connection value clash (#8559)

kpczerwinski/open-1998-ux-make-some-text-non-selectable-on-the-builder-page^2
Zamil Majdy 2024-11-05 12:43:07 +07:00 committed by GitHub
parent cd106611eb
commit e84910b423
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 6 deletions

View File

@ -352,14 +352,9 @@ const NodeKeyValueInput: FC<{
const defaultEntries = new Map(
Object.entries(entries ?? schema.default ?? {}),
);
const prefix = `${selfKey}_#_`;
connections
.filter((c) => c.targetHandle.startsWith(prefix))
.map((c) => c.targetHandle.slice(prefix.length))
.forEach((k) => !defaultEntries.has(k) && defaultEntries.set(k, ""));
return Array.from(defaultEntries, ([key, value]) => ({ key, value }));
}, [connections, entries, schema.default, selfKey]);
}, [entries, schema.default]);
const [keyValuePairs, setKeyValuePairs] = useState<
{ key: string; value: string | number | null }[]