diff --git a/web/app/components/app/configuration/config/automatic/get-automatic-res.tsx b/web/app/components/app/configuration/config/automatic/get-automatic-res.tsx index c18300ecfd..ee77a6d6eb 100644 --- a/web/app/components/app/configuration/config/automatic/get-automatic-res.tsx +++ b/web/app/components/app/configuration/config/automatic/get-automatic-res.tsx @@ -134,10 +134,12 @@ const GetAutomaticRes: FC = ({ const [instruction, setInstruction] = useState('') const [ideaOutput, setIdeaOutput] = useState('') + const [editorKey, setEditorKey] = useState(`${flowId}-0`) const handleChooseTemplate = useCallback((key: string) => { return () => { const template = t(`appDebug.generate.template.${key}.instruction`) setInstruction(template) + setEditorKey(`${flowId}-${Date.now()}`) } }, [t]) const isValid = () => { @@ -318,6 +320,7 @@ const GetAutomaticRes: FC = ({
{t('appDebug.generate.instruction')}
{isBasicMode ? ( = ({ /> ) : ( void generatorType: GeneratorType } @@ -18,6 +19,7 @@ type Props = { const InstructionEditorInWorkflow: FC = ({ nodeId, value, + editorKey, onChange, generatorType, }) => { @@ -37,6 +39,7 @@ const InstructionEditorInWorkflow: FC = ({ void generatorType: GeneratorType @@ -24,6 +25,7 @@ type Props = { const i18nPrefix = 'appDebug.generate' const InstructionEditor: FC = ({ + editorKey, generatorType, value, onChange, @@ -50,7 +52,7 @@ const InstructionEditor: FC = ({
= ( const [ideaOutput, setIdeaOutput] = useState('') const [isLoading, { setTrue: setLoadingTrue, setFalse: setLoadingFalse }] = useBoolean(false) - const storageKey = `${flowId}-${nodeId}}` + const storageKey = `${flowId}-${nodeId}` const { addVersion, current, currentVersionIndex, setCurrentVersionIndex, versions } = useGenData({ storageKey, })