diff --git a/src/frontend/src/customNodes/genericNode/components/parameterComponent/index.tsx b/src/frontend/src/customNodes/genericNode/components/parameterComponent/index.tsx index 50773aabc..f1a4d93f1 100644 --- a/src/frontend/src/customNodes/genericNode/components/parameterComponent/index.tsx +++ b/src/frontend/src/customNodes/genericNode/components/parameterComponent/index.tsx @@ -62,8 +62,6 @@ export default function ParameterComponent({ index, outputName, }: ParameterComponentType): JSX.Element { - console.log("title", title); - console.log("data", data); const infoHtml = useRef(null); const nodes = useFlowStore((state) => state.nodes); const edges = useFlowStore((state) => state.edges); @@ -82,7 +80,7 @@ export default function ParameterComponent({ debouncedHandleUpdateValues, setNode, isLoading, - setIsLoading + setIsLoading, ); const { handleNodeClass: handleNodeClassHook } = useHandleNodeClass( @@ -90,7 +88,7 @@ export default function ParameterComponent({ name, takeSnapshot, setNode, - updateNodeInternals + updateNodeInternals, ); const { handleRefreshButtonPress: handleRefreshButtonPressHook } = @@ -99,7 +97,7 @@ export default function ParameterComponent({ let disabled = edges.some( (edge) => - edge.targetHandle === scapedJSONStringfy(proxy ? { ...id, proxy } : id) + edge.targetHandle === scapedJSONStringfy(proxy ? { ...id, proxy } : id), ) ?? false; const handleRefreshButtonPress = async (name, data) => { @@ -110,7 +108,7 @@ export default function ParameterComponent({ const handleOnNewValue = async ( newValue: string | string[] | boolean | Object[], - skipSnapshot: boolean | undefined = false + skipSnapshot: boolean | undefined = false, ): Promise => { handleOnNewValueHook(newValue, skipSnapshot); }; @@ -192,14 +190,14 @@ export default function ParameterComponent({ className={classNames( left ? "my-12 -ml-0.5 " : " my-12 -mr-0.5 ", "h-3 w-3 rounded-full border-2 bg-background", - !showNode ? "mt-0" : "" + !showNode ? "mt-0" : "", )} style={{ borderColor: color ?? nodeColors.unknown, }} onClick={() => { setFilterEdge( - groupByFamily(myData, tooltipTitle!, left, nodes!) + groupByFamily(myData, tooltipTitle!, left, nodes!), ); }} > @@ -284,12 +282,12 @@ export default function ParameterComponent({ } className={classNames( left ? "-ml-0.5" : "-mr-0.5", - "h-3 w-3 rounded-full border-2 bg-background" + "h-3 w-3 rounded-full border-2 bg-background", )} style={{ borderColor: color ?? nodeColors.unknown }} onClick={() => { setFilterEdge( - groupByFamily(myData, tooltipTitle!, left, nodes!) + groupByFamily(myData, tooltipTitle!, left, nodes!), ); }} /> diff --git a/src/frontend/src/utils/reactflowUtils.ts b/src/frontend/src/utils/reactflowUtils.ts index 261a39b6c..a32a2e31b 100644 --- a/src/frontend/src/utils/reactflowUtils.ts +++ b/src/frontend/src/utils/reactflowUtils.ts @@ -79,15 +79,21 @@ export function cleanEdges(nodes: NodeType[], edges: Edge[]) { const output = sourceNode.data.node!.outputs?.find( (output) => output.name === name, ); - const outputTypes = [output?.selected ?? ""]; - const id: sourceHandleType = { - id: sourceNode.data.id, - name: name, - output_types: outputTypes, - dataType: sourceNode.data.type, - }; - if (scapedJSONStringfy(id) !== sourceHandle) { - newEdges = newEdges.filter((e) => e.id !== edge.id); + if (output) { + const outputTypes = + output!.types.length === 1 ? output!.types : [output!.selected!]; + + const id: sourceHandleType = { + id: sourceNode.data.id, + name: name, + output_types: outputTypes, + dataType: sourceNode.data.type, + }; + console.log("id", id); + console.log("sourceHandle", scapeJSONParse(sourceHandle)); + if (scapedJSONStringfy(id) !== sourceHandle) { + newEdges = newEdges.filter((e) => e.id !== edge.id); + } } } });