mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-27 08:25:07 +00:00
perf: remove unuse code (#2227)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import React, { useEffect } from 'react';
|
||||
import { $getRoot, EditorState, type LexicalEditor } from 'lexical';
|
||||
import { useCallback, useTransition } from 'react';
|
||||
import { useCallback } from 'react';
|
||||
import { editorStateToText } from '../../Textarea/PromptEditor/utils';
|
||||
import { EditorVariablePickerType } from '../../Textarea/PromptEditor/type';
|
||||
import Editor from './Editor';
|
||||
@@ -30,18 +30,14 @@ const HttpInput = ({
|
||||
}) => {
|
||||
const [currentValue, setCurrentValue] = React.useState(value);
|
||||
|
||||
const [, startSts] = useTransition();
|
||||
|
||||
const onChangeInput = useCallback((editorState: EditorState, editor: LexicalEditor) => {
|
||||
const text = editorStateToText(editor).replaceAll('}}{{', '}} {{');
|
||||
setCurrentValue(text);
|
||||
onChange?.(text);
|
||||
}, []);
|
||||
const onBlurInput = useCallback((editor: LexicalEditor) => {
|
||||
startSts(() => {
|
||||
const text = editorStateToText(editor).replaceAll('}}{{', '}} {{');
|
||||
onBlur?.(text);
|
||||
});
|
||||
const text = editorStateToText(editor).replaceAll('}}{{', '}} {{');
|
||||
onBlur?.(text);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
|
Reference in New Issue
Block a user