Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

Fix: avoid mutating node props (#26266)

Yongtao Huang319ecdd31286
diff --git a/web/app/components/workflow/nodes/iteration/node.tsx b/web/app/components/workflow/nodes/iteration/node.tsx
index 0232c8755f6..59b96b1e2d7 100644
--- a/web/app/components/workflow/nodes/iteration/node.tsx
+++ b/web/app/components/workflow/nodes/iteration/node.tsx
@@ -2,6 +2,7 @@ import type { FC } from 'react'
import {
memo,
useEffect,
+ useState,
} from 'react'
import {
Background,
@@ -27,19 +28,20 @@ const Node: FC<NodeProps<IterationNodeType>> = ({
const nodesInitialized = useNodesInitialized()
const { handleNodeIterationRerender } = useNodeIterationInteractions()
const { t } = useTranslation()
+ const [showTips, setShowTips] = useState(data._isShowTips)
useEffect(() => {
if (nodesInitialized)
handleNodeIterationRerender(id)
- if (data.is_parallel && data._isShowTips) {
+ if (data.is_parallel && showTips) {
Toast.notify({
type: 'warning',
message: t(`${i18nPrefix}.answerNodeWarningDesc`),
duration: 5000,
})
- data._isShowTips = false
+ setShowTips(false)
}
- }, [nodesInitialized, id, handleNodeIterationRerender, data, t])
+ }, [nodesInitialized, id, handleNodeIterationRerender, data.is_parallel, showTips, t])
return (
<div className={cn(