feat: error connections
This commit is contained in:
@@ -52,6 +52,8 @@ function RenderingNodeComponent({ id, data, width, height, selected }: Props) {
|
||||
const setFullscreenNodeId = flowContext?.setFullscreenNodeId
|
||||
const startConnectionPathUpdate = flowContext?.startConnectionPathUpdate
|
||||
const endConnectionPathUpdate = flowContext?.endConnectionPathUpdate
|
||||
const addConnectionPathError = flowContext?.addConnectionPathError
|
||||
const removeConnectionPathError = flowContext?.removeConnectionPathError
|
||||
const supportsFullscreen = getNodeType('render')?.supportsFullscreen
|
||||
const [renderedContent, setRenderedContent] = useState<string | null>(null)
|
||||
const [resolvedContent, setResolvedContent] = useState<string | null>(null)
|
||||
@@ -78,6 +80,15 @@ function RenderingNodeComponent({ id, data, width, height, selected }: Props) {
|
||||
const sourceContent = srcNode?.type === 'config' ? getConfigContent((srcNode.data ?? undefined) as Record<string, unknown> | undefined) : isAgentSource ? agentOutputMarkdown : ''
|
||||
const srcData = srcNode?.data ?? {}
|
||||
|
||||
useEffect(() => {
|
||||
if (!addConnectionPathError || !removeConnectionPathError) return
|
||||
if (error != null) {
|
||||
addConnectionPathError(id)
|
||||
return () => removeConnectionPathError(id)
|
||||
}
|
||||
removeConnectionPathError(id)
|
||||
}, [id, error, addConnectionPathError, removeConnectionPathError])
|
||||
|
||||
/** Set of node IDs that can affect this render node (configs in the chain + variables/functions feeding them) */
|
||||
const connectedNodeIds = useMemo(() => {
|
||||
const out = new Set<string>()
|
||||
|
||||
Reference in New Issue
Block a user