mirror of
https://github.com/langgenius/dify.git
synced 2026-05-04 01:18:05 +08:00
fix: node default
This commit is contained in:
@ -8,13 +8,14 @@ import { BlockEnum } from '@/app/components/workflow/types'
|
||||
import { BlockClassificationEnum } from '@/app/components/workflow/block-selector/types'
|
||||
const i18nPrefix = 'workflow.errorMsg'
|
||||
|
||||
const metaData = genNodeMetaData({
|
||||
classification: BlockClassificationEnum.Logic,
|
||||
sort: 3,
|
||||
type: BlockEnum.Loop,
|
||||
author: 'AICT-Team',
|
||||
})
|
||||
const nodeDefault: NodeDefault<LoopNodeType> = {
|
||||
...genNodeMetaData({
|
||||
classification: BlockClassificationEnum.Logic,
|
||||
sort: 3,
|
||||
type: BlockEnum.Loop,
|
||||
// author: 'AICT-Team',
|
||||
}),
|
||||
metaData,
|
||||
defaultValue: {
|
||||
start_node_id: '',
|
||||
break_conditions: [],
|
||||
|
||||
@ -116,7 +116,6 @@ export const useNodeLoopInteractions = () => {
|
||||
const childNodeType = child.data.type as BlockEnum
|
||||
const {
|
||||
defaultValue,
|
||||
title,
|
||||
} = nodesMetaDataMap![childNodeType]
|
||||
const nodesWithSameType = nodes.filter(node => node.data.type === childNodeType)
|
||||
const { newNode } = generateNewNode({
|
||||
@ -128,7 +127,7 @@ export const useNodeLoopInteractions = () => {
|
||||
_isBundled: false,
|
||||
_connectedSourceHandleIds: [],
|
||||
_connectedTargetHandleIds: [],
|
||||
title: nodesWithSameType.length > 0 ? `${title} ${nodesWithSameType.length + 1}` : title,
|
||||
title: nodesWithSameType.length > 0 ? `${defaultValue.title} ${nodesWithSameType.length + 1}` : defaultValue.title,
|
||||
loop_id: newNodeId,
|
||||
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user