diff --git a/src/frontend/src/CustomNodes/GenericNode/components/NodeOutputfield/index.tsx b/src/frontend/src/CustomNodes/GenericNode/components/NodeOutputfield/index.tsx index 7ab945713..bb47ed848 100644 --- a/src/frontend/src/CustomNodes/GenericNode/components/NodeOutputfield/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/components/NodeOutputfield/index.tsx @@ -213,6 +213,12 @@ function NodeOutputField({ [flowPool, flowPoolId, flowPoolNode?.data, internalOutputName], ); + const emptyOutput = useMemo(() => { + return Object.keys(flowPoolNode?.data?.outputs ?? {})?.every( + (key) => flowPoolNode?.data?.outputs[key]?.message?.length === 0, + ); + }, [flowPoolNode?.data?.outputs]); + const disabledOutput = useMemo( () => edges.some((edge) => edge.sourceHandle === scapedJSONStringfy(id)), [edges, id], @@ -369,6 +375,9 @@ function NodeOutputField({ ], ); + const disabledInspectButton = + !displayOutputPreview || unknownOutput || emptyOutput; + if (!showNode) return <>{Handle}; return ( @@ -424,7 +433,7 @@ function NodeOutputField({