Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵月辉
/
fastgpt-migrated
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
1529c1e9
authored
Apr 30, 2024
by
Cheer
Committed by
GitHub
Apr 30, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: issues/1334 useTransition 导致光标刷新后移问题; (#1338)
parent
db6fc538
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
9 deletions
+2
-9
projects/app/src/components/core/workflow/Flow/nodes/NodeHttp/index.tsx
+2
-9
No files found.
projects/app/src/components/core/workflow/Flow/nodes/NodeHttp/index.tsx
View file @
1529c1e9
...
@@ -28,18 +28,13 @@ import { useToast } from '@fastgpt/web/hooks/useToast';
...
@@ -28,18 +28,13 @@ import { useToast } from '@fastgpt/web/hooks/useToast';
import
MyTooltip
from
'@fastgpt/web/components/common/MyTooltip'
;
import
MyTooltip
from
'@fastgpt/web/components/common/MyTooltip'
;
import
{
QuestionOutlineIcon
}
from
'@chakra-ui/icons'
;
import
{
QuestionOutlineIcon
}
from
'@chakra-ui/icons'
;
import
JSONEditor
from
'@fastgpt/web/components/common/Textarea/JsonEditor'
;
import
JSONEditor
from
'@fastgpt/web/components/common/Textarea/JsonEditor'
;
import
{
import
{
formatEditorVariablePickerIcon
}
from
'@fastgpt/global/core/workflow/utils'
;
formatEditorVariablePickerIcon
,
getGuideModule
,
splitGuideModule
}
from
'@fastgpt/global/core/workflow/utils'
;
import
{
EditorVariablePickerType
}
from
'@fastgpt/web/components/common/Textarea/PromptEditor/type'
;
import
{
EditorVariablePickerType
}
from
'@fastgpt/web/components/common/Textarea/PromptEditor/type'
;
import
HttpInput
from
'@fastgpt/web/components/common/Input/HttpInput'
;
import
HttpInput
from
'@fastgpt/web/components/common/Input/HttpInput'
;
import
dynamic
from
'next/dynamic'
;
import
dynamic
from
'next/dynamic'
;
import
MySelect
from
'@fastgpt/web/components/common/MySelect'
;
import
MySelect
from
'@fastgpt/web/components/common/MySelect'
;
import
RenderToolInput
from
'../render/RenderToolInput'
;
import
RenderToolInput
from
'../render/RenderToolInput'
;
import
IOTitle
from
'../../components/IOTitle'
;
import
IOTitle
from
'../../components/IOTitle'
;
import
{
getSystemVariables
}
from
'@/web/core/app/utils'
;
import
{
useContextSelector
}
from
'use-context-selector'
;
import
{
useContextSelector
}
from
'use-context-selector'
;
import
{
WorkflowContext
}
from
'../../../context'
;
import
{
WorkflowContext
}
from
'../../../context'
;
import
{
getWorkflowGlobalVariables
}
from
'@/web/core/workflow/utils'
;
import
{
getWorkflowGlobalVariables
}
from
'@/web/core/workflow/utils'
;
...
@@ -106,7 +101,6 @@ const RenderHttpMethodAndUrl = React.memo(function RenderHttpMethodAndUrl({
...
@@ -106,7 +101,6 @@ const RenderHttpMethodAndUrl = React.memo(function RenderHttpMethodAndUrl({
})
{
})
{
const
{
t
}
=
useTranslation
();
const
{
t
}
=
useTranslation
();
const
{
toast
}
=
useToast
();
const
{
toast
}
=
useToast
();
const
[
_
,
startSts
]
=
useTransition
();
const
onChangeNode
=
useContextSelector
(
WorkflowContext
,
(
v
)
=>
v
.
onChangeNode
);
const
onChangeNode
=
useContextSelector
(
WorkflowContext
,
(
v
)
=>
v
.
onChangeNode
);
const
{
isOpen
:
isOpenCurl
,
onOpen
:
onOpenCurl
,
onClose
:
onCloseCurl
}
=
useDisclosure
();
const
{
isOpen
:
isOpenCurl
,
onOpen
:
onOpenCurl
,
onClose
:
onCloseCurl
}
=
useDisclosure
();
...
@@ -116,7 +110,6 @@ const RenderHttpMethodAndUrl = React.memo(function RenderHttpMethodAndUrl({
...
@@ -116,7 +110,6 @@ const RenderHttpMethodAndUrl = React.memo(function RenderHttpMethodAndUrl({
const
onChangeUrl
=
useCallback
(
const
onChangeUrl
=
useCallback
(
(
e
:
React
.
ChangeEvent
<
HTMLInputElement
>
)
=>
{
(
e
:
React
.
ChangeEvent
<
HTMLInputElement
>
)
=>
{
startSts
(()
=>
{
onChangeNode
({
onChangeNode
({
nodeId
,
nodeId
,
type
:
'updateInput'
,
type
:
'updateInput'
,
...
@@ -126,10 +119,10 @@ const RenderHttpMethodAndUrl = React.memo(function RenderHttpMethodAndUrl({
...
@@ -126,10 +119,10 @@ const RenderHttpMethodAndUrl = React.memo(function RenderHttpMethodAndUrl({
value
:
e
.
target
.
value
value
:
e
.
target
.
value
}
}
});
});
});
},
},
[
nodeId
,
onChangeNode
,
requestUrl
]
[
nodeId
,
onChangeNode
,
requestUrl
]
);
);
const
onBlurUrl
=
useCallback
(
const
onBlurUrl
=
useCallback
(
(
e
:
React
.
ChangeEvent
<
HTMLInputElement
>
)
=>
{
(
e
:
React
.
ChangeEvent
<
HTMLInputElement
>
)
=>
{
const
val
=
e
.
target
.
value
;
const
val
=
e
.
target
.
value
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment