mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-21 05:16:54 +08:00
Fix: Fixed the issue that the condition of deleting the classification operator cannot be connected anymore #3221 (#9068)
### What problem does this PR solve? Fix: Fixed the issue that the condition of deleting the classification operator cannot be connected anymore #3221 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -5,6 +5,7 @@ import {
|
||||
EdgeProps,
|
||||
getBezierPath,
|
||||
} from '@xyflow/react';
|
||||
import { memo } from 'react';
|
||||
import useGraphStore from '../../store';
|
||||
|
||||
import { useFetchAgent } from '@/hooks/use-agent-request';
|
||||
@ -12,7 +13,7 @@ import { cn } from '@/lib/utils';
|
||||
import { useMemo } from 'react';
|
||||
import { NodeHandleId, Operator } from '../../constant';
|
||||
|
||||
export function ButtonEdge({
|
||||
function InnerButtonEdge({
|
||||
id,
|
||||
sourceX,
|
||||
sourceY,
|
||||
@ -77,7 +78,8 @@ export function ButtonEdge({
|
||||
const visible = useMemo(() => {
|
||||
return (
|
||||
data?.isHovered &&
|
||||
sourceHandleId !== NodeHandleId.Tool && // The connection between the agent node and the tool node does not need to display the delete button
|
||||
sourceHandleId !== NodeHandleId.Tool &&
|
||||
sourceHandleId !== NodeHandleId.AgentBottom && // The connection between the agent node and the tool node does not need to display the delete button
|
||||
!target.startsWith(Operator.Tool)
|
||||
);
|
||||
}, [data?.isHovered, sourceHandleId, target]);
|
||||
@ -120,3 +122,5 @@ export function ButtonEdge({
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export const ButtonEdge = memo(InnerButtonEdge);
|
||||
|
||||
Reference in New Issue
Block a user