Update proxy IDs on group node outputs (#2364)

This pull request focuses on updating the proxy IDs for the outputs of
group nodes within our project.
This commit is contained in:
anovazzi1 2024-06-28 20:40:19 +00:00 committed by GitHub
commit d629ff2fb5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1117,6 +1117,18 @@ export function updateProxyIdsOnTemplate(
});
}
export function updateProxyIdsOnOutputs(
outputs: OutputFieldType[] | undefined,
idsMap: { [key: string]: string },
) {
if (!outputs) return;
outputs.forEach((output) => {
if (output.proxy && idsMap[output.proxy.id]) {
output.proxy.id = idsMap[output.proxy.id];
}
});
}
export function updateEdgesIds(
edges: Edge[],
idsMap: { [key: string]: string },
@ -1485,6 +1497,7 @@ export function updateGroupRecursion(groupNode: NodeType, edges: Edge[]) {
let newFlow = groupNode.data.node!.flow;
const idsMap = updateIds(newFlow.data!);
updateProxyIdsOnTemplate(groupNode.data.node!.template, idsMap);
updateProxyIdsOnOutputs(groupNode.data.node.outputs, idsMap);
let flowEdges = edges;
updateEdgesIds(flowEdges, idsMap);
}