From 1529c1e9912a0f262696f7620fca07a8d88f83d7 Mon Sep 17 00:00:00 2001 From: Cheer Date: Tue, 30 Apr 2024 15:59:39 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20issues/1334=20useTransition=20=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E5=85=89=E6=A0=87=E5=88=B7=E6=96=B0=E5=90=8E=E7=A7=BB?= =?UTF-8?q?=E9=97=AE=E9=A2=98;=20(#1338)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workflow/Flow/nodes/NodeHttp/index.tsx | 27 +++++++------------ 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/projects/app/src/components/core/workflow/Flow/nodes/NodeHttp/index.tsx b/projects/app/src/components/core/workflow/Flow/nodes/NodeHttp/index.tsx index deb72b1de51..5c670047f33 100644 --- a/projects/app/src/components/core/workflow/Flow/nodes/NodeHttp/index.tsx +++ b/projects/app/src/components/core/workflow/Flow/nodes/NodeHttp/index.tsx @@ -28,18 +28,13 @@ import { useToast } from '@fastgpt/web/hooks/useToast'; import MyTooltip from '@fastgpt/web/components/common/MyTooltip'; import { QuestionOutlineIcon } from '@chakra-ui/icons'; import JSONEditor from '@fastgpt/web/components/common/Textarea/JsonEditor'; -import { - formatEditorVariablePickerIcon, - getGuideModule, - splitGuideModule -} from '@fastgpt/global/core/workflow/utils'; +import { formatEditorVariablePickerIcon } from '@fastgpt/global/core/workflow/utils'; import { EditorVariablePickerType } from '@fastgpt/web/components/common/Textarea/PromptEditor/type'; import HttpInput from '@fastgpt/web/components/common/Input/HttpInput'; import dynamic from 'next/dynamic'; import MySelect from '@fastgpt/web/components/common/MySelect'; import RenderToolInput from '../render/RenderToolInput'; import IOTitle from '../../components/IOTitle'; -import { getSystemVariables } from '@/web/core/app/utils'; import { useContextSelector } from 'use-context-selector'; import { WorkflowContext } from '../../../context'; import { getWorkflowGlobalVariables } from '@/web/core/workflow/utils'; @@ -106,7 +101,6 @@ const RenderHttpMethodAndUrl = React.memo(function RenderHttpMethodAndUrl({ }) { const { t } = useTranslation(); const { toast } = useToast(); - const [_, startSts] = useTransition(); const onChangeNode = useContextSelector(WorkflowContext, (v) => v.onChangeNode); const { isOpen: isOpenCurl, onOpen: onOpenCurl, onClose: onCloseCurl } = useDisclosure(); @@ -116,20 +110,19 @@ const RenderHttpMethodAndUrl = React.memo(function RenderHttpMethodAndUrl({ const onChangeUrl = useCallback( (e: React.ChangeEvent) => { - startSts(() => { - onChangeNode({ - nodeId, - type: 'updateInput', - key: NodeInputKeyEnum.httpReqUrl, - value: { - ...requestUrl, - value: e.target.value - } - }); + onChangeNode({ + nodeId, + type: 'updateInput', + key: NodeInputKeyEnum.httpReqUrl, + value: { + ...requestUrl, + value: e.target.value + } }); }, [nodeId, onChangeNode, requestUrl] ); + const onBlurUrl = useCallback( (e: React.ChangeEvent) => { const val = e.target.value;