mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-31 01:01:30 +08:00
### What problem does this PR solve? Feat: Handling abnormal anchor points of agent operators #3221 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -30,40 +30,6 @@ export const useBuildFormSelectOptions = (
|
||||
return buildCategorizeToOptions;
|
||||
};
|
||||
|
||||
/**
|
||||
* dumped
|
||||
* @param nodeId
|
||||
* @returns
|
||||
*/
|
||||
export const useHandleFormSelectChange = (nodeId?: string) => {
|
||||
const { addEdge, deleteEdgeBySourceAndSourceHandle } = useGraphStore(
|
||||
(state) => state,
|
||||
);
|
||||
const handleSelectChange = useCallback(
|
||||
(name?: string) => (value?: string) => {
|
||||
if (nodeId && name) {
|
||||
if (value) {
|
||||
addEdge({
|
||||
source: nodeId,
|
||||
target: value,
|
||||
sourceHandle: name,
|
||||
targetHandle: null,
|
||||
});
|
||||
} else {
|
||||
// clear selected value
|
||||
deleteEdgeBySourceAndSourceHandle({
|
||||
source: nodeId,
|
||||
sourceHandle: name,
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
[addEdge, nodeId, deleteEdgeBySourceAndSourceHandle],
|
||||
);
|
||||
|
||||
return { handleSelectChange };
|
||||
};
|
||||
|
||||
export const useBuildSortOptions = () => {
|
||||
const { t } = useTranslate('flow');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user