Clean up legacy conditions data in if-else nodes to prevent misjudgments (#28148)

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
耐小心
2025-11-21 14:26:57 +08:00
committed by GitHub
parent 1a2f8dfcb4
commit 4486b54680
3 changed files with 23 additions and 31 deletions

View File

@@ -242,6 +242,11 @@ export const initialNodes = (originNodes: Node[], originEdges: Edge[]) => {
...(node.data as IfElseNodeType).cases.map(item => ({ id: item.case_id, name: '' })),
{ id: 'false', name: '' },
])
// delete conditions and logical_operator if cases is not empty
if (nodeData.cases.length > 0 && nodeData.conditions && nodeData.logical_operator) {
delete nodeData.conditions
delete nodeData.logical_operator
}
}
if (node.data.type === BlockEnum.QuestionClassifier) {