"test/ut/git@developer.sourcefind.cn:OpenDAS/nni.git" did not exist on "98875f52e7c33d024b372bfd7cc30b1c0fbe0605"
Commit 6f54b019 authored by ssit's avatar ssit
Browse files

Fix reroute node connecting different types

parent 186f9204
...@@ -24,9 +24,13 @@ app.registerExtension({ ...@@ -24,9 +24,13 @@ app.registerExtension({
// Ignore wildcard nodes as these will be updated to real types // Ignore wildcard nodes as these will be updated to real types
const types = new Set(this.outputs[0].links.map((l) => app.graph.links[l].type).filter((t) => t !== "*")); const types = new Set(this.outputs[0].links.map((l) => app.graph.links[l].type).filter((t) => t !== "*"));
if (types.size > 1) { if (types.size > 1) {
const linksToDisconnect = [];
for (let i = 0; i < this.outputs[0].links.length - 1; i++) { for (let i = 0; i < this.outputs[0].links.length - 1; i++) {
const linkId = this.outputs[0].links[i]; const linkId = this.outputs[0].links[i];
const link = app.graph.links[linkId]; const link = app.graph.links[linkId];
linksToDisconnect.push(link);
}
for (const link of linksToDisconnect) {
const node = app.graph.getNodeById(link.target_id); const node = app.graph.getNodeById(link.target_id);
node.disconnectInput(link.target_slot); node.disconnectInput(link.target_slot);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment