From 6f54b01954031762a97b2e31074086dc69f9c142 Mon Sep 17 00:00:00 2001 From: ssit Date: Tue, 20 Jun 2023 15:25:56 -0400 Subject: [PATCH] Fix reroute node connecting different types --- web/extensions/core/rerouteNode.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web/extensions/core/rerouteNode.js b/web/extensions/core/rerouteNode.js index c31f63cd..499a171d 100644 --- a/web/extensions/core/rerouteNode.js +++ b/web/extensions/core/rerouteNode.js @@ -24,9 +24,13 @@ app.registerExtension({ // 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 !== "*")); if (types.size > 1) { + const linksToDisconnect = []; for (let i = 0; i < this.outputs[0].links.length - 1; i++) { const linkId = this.outputs[0].links[i]; const link = app.graph.links[linkId]; + linksToDisconnect.push(link); + } + for (const link of linksToDisconnect) { const node = app.graph.getNodeById(link.target_id); node.disconnectInput(link.target_slot); }