mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 02:18:08 +08:00
comment mode can't click node
This commit is contained in:
@ -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>(
|
||||||
|
|||||||
Reference in New Issue
Block a user