mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-26 00:46:52 +08:00
### What problem does this PR solve? Feat: Delete the operator node and hide the corresponding sheet #3221 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -167,3 +167,15 @@ export function useShowLogSheet({
|
||||
showLogSheet: handleShow,
|
||||
};
|
||||
}
|
||||
|
||||
export function useHideFormSheetOnNodeDeletion({
|
||||
hideFormDrawer,
|
||||
}: Pick<ReturnType<typeof useShowFormDrawer>, 'hideFormDrawer'>) {
|
||||
const { nodes, clickedNodeId } = useGraphStore((state) => state);
|
||||
|
||||
useEffect(() => {
|
||||
if (!nodes.some((x) => x.id === clickedNodeId)) {
|
||||
hideFormDrawer();
|
||||
}
|
||||
}, [clickedNodeId, hideFormDrawer, nodes]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user