comment mode can't click node

This commit is contained in:
hjlarry 2025-11-05 14:14:36 +08:00
parent 2f60288d86
commit fb9cbc0471
1 changed files with 4 additions and 2 deletions

View File

@ -17,7 +17,7 @@ import {
} from 'reactflow'
import type { DataSourceDefaultValue, ToolDefaultValue } from '../block-selector/types'
import type { Edge, Node, OnNodeAdd } from '../types'
import { BlockEnum } from '../types'
import { BlockEnum, ControlMode } from '../types'
import { useWorkflowStore } from '../store'
import {
CUSTOM_EDGE,
@ -339,12 +339,14 @@ export const useNodesInteractions = () => {
const handleNodeClick = useCallback<NodeMouseHandler>(
(_, node) => {
const { controlMode } = workflowStore.getState()
if (controlMode === ControlMode.Comment) return
if (node.type === CUSTOM_ITERATION_START_NODE) return
if (node.type === CUSTOM_LOOP_START_NODE) return
if (node.data.type === BlockEnum.DataSourceEmpty) return
handleNodeSelect(node.id)
},
[handleNodeSelect],
[handleNodeSelect, workflowStore],
)
const handleNodeConnect = useCallback<OnConnect>(