From 82da0ec4f6c7e4b01c131144d9142a3d7958df6b Mon Sep 17 00:00:00 2001 From: omar92 Date: Sat, 8 Apr 2023 20:18:24 +0200 Subject: [PATCH] not losing connection all time --- web/extensions/core/rerouteNode.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/web/extensions/core/rerouteNode.js b/web/extensions/core/rerouteNode.js index 5a7327cb9..ac0b5d79e 100644 --- a/web/extensions/core/rerouteNode.js +++ b/web/extensions/core/rerouteNode.js @@ -93,9 +93,10 @@ app.registerExtension({ const nodeOutType = node.inputs && node.inputs[link?.target_slot] && node.inputs[link.target_slot].type ? node.inputs[link.target_slot].type : null; if (inputType && nodeOutType !== inputType) { // The output doesnt match our input so disconnect it - console.log("Disconnecting", {"node":node}, "as it doesnt match type of ", {"inputNode":inputNode}); - - node.disconnectInput(link.target_slot); + console.log("Disconnecting", { "node": node }, "as it doesnt match type of ", { "inputNode": inputNode }); + console.log("Input type:", inputType, "Output type:", nodeOutType); + if (inputNode.type !== "Reroute") + node.disconnectInput(link.target_slot); } else { outputType = nodeOutType; }