diff --git a/web/app/components/workflow/nodes/llm/components/config-prompt-item.tsx b/web/app/components/workflow/nodes/llm/components/config-prompt-item.tsx index ff571af9d2..e62b024d1a 100644 --- a/web/app/components/workflow/nodes/llm/components/config-prompt-item.tsx +++ b/web/app/components/workflow/nodes/llm/components/config-prompt-item.tsx @@ -1,7 +1,6 @@ 'use client' import type { FC } from 'react' -import React, { useCallback, useEffect, useState } from 'react' -import { uniqueId } from 'lodash-es' +import React, { useCallback } from 'react' import { useTranslation } from 'react-i18next' import type { ModelConfig, PromptItem, Variable } from '../../../types' import { EditionType } from '../../../types' @@ -14,6 +13,7 @@ import { PromptRole } from '@/models/debug' const i18nPrefix = 'workflow.nodes.llm' type Props = { + instanceId: string className?: string headerClassName?: string canNotChooseSystemRole?: boolean @@ -59,6 +59,7 @@ const roleOptions = [ const roleOptionsWithoutSystemRole = roleOptions.filter(item => item.value !== PromptRole.system) const ConfigPromptItem: FC = ({ + instanceId, className, headerClassName, canNotChooseSystemRole, @@ -86,10 +87,6 @@ const ConfigPromptItem: FC = ({ const { setControlPromptEditorRerenderKey, } = workflowStore.getState() - const [instanceId, setInstanceId] = useState(uniqueId()) - useEffect(() => { - setInstanceId(`${id}-${uniqueId()}`) - }, [id]) const handleGenerated = useCallback((prompt: string) => { onPromptChange(prompt) diff --git a/web/app/components/workflow/nodes/llm/components/config-prompt.tsx b/web/app/components/workflow/nodes/llm/components/config-prompt.tsx index b8a68f364f..fee762bd25 100644 --- a/web/app/components/workflow/nodes/llm/components/config-prompt.tsx +++ b/web/app/components/workflow/nodes/llm/components/config-prompt.tsx @@ -182,6 +182,7 @@ const ConfigPrompt: FC = ({
{canDrag && }