comment mode can't click node

This commit is contained in:
hjlarry
2025-11-05 14:14:36 +08:00
parent 2f60288d86
commit fb9cbc0471

View File

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