diff --git a/src/components/graph/RenderingNode.tsx b/src/components/graph/RenderingNode.tsx index 4154ba0..b25a18e 100644 --- a/src/components/graph/RenderingNode.tsx +++ b/src/components/graph/RenderingNode.tsx @@ -34,6 +34,24 @@ export const RenderingNode = memo(function RenderingNode({ id }: Props) { const yamlText = srcNode && srcNode.type === 'config' ? srcNode?.data?.yaml ?? '' : '' const srcData = srcNode?.data ?? {} + const configSignature = useMemo( + () => + nodes + .filter((n: any) => n.type === 'config') + .map((n: any) => `${n.id}:${n.data?.title ?? ''}:${n.data?.yaml ?? ''}`) + .join('|'), + [nodes] + ) + + const edgesSignature = useMemo( + () => + edges + .map((e: any) => `${e.source}->${e.target}`) + .sort() + .join('|'), + [edges] + ) + useEffect(() => { // debug // eslint-disable-next-line no-console @@ -104,7 +122,7 @@ export const RenderingNode = memo(function RenderingNode({ id }: Props) { setOutput('') setError({ kind: 'parse', message: msg }) } - }, [id, incomingIds.join(','), yamlText, nodes.length, edges.length]) + }, [id, incomingIds.join(','), yamlText, configSignature, edgesSignature]) return (