Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
2360fb29
Commit
2360fb29
authored
Mar 08, 2024
by
StyleZhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update data
parent
1c82e387
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
hooks.ts
web/app/components/workflow/hooks.ts
+5
-3
No files found.
web/app/components/workflow/hooks.ts
View file @
2360fb29
import
{
useCallback
}
from
'react'
import
{
useTranslation
}
from
'react-i18next'
import
produce
from
'immer'
import
{
debounce
}
from
'lodash-es'
import
type
{
EdgeMouseHandler
,
NodeDragHandler
,
...
...
@@ -50,7 +51,7 @@ export const useWorkflow = () => {
const
nodesInitialData
=
useNodesInitialData
()
const
featuresStore
=
useFeaturesStore
()
const
handleSyncWorkflowDraft
=
useCallback
(()
=>
{
const
handleSyncWorkflowDraft
=
useCallback
(
debounce
(
()
=>
{
const
{
getNodes
,
edges
,
...
...
@@ -83,7 +84,7 @@ export const useWorkflow = () => {
useStore
.
setState
({
draftUpdatedAt
:
res
.
updated_at
})
})
}
},
[
store
,
reactFlow
,
featuresStore
])
},
2000
,
{
trailing
:
true
}),
[
store
,
reactFlow
,
featuresStore
])
const
handleLayout
=
useCallback
(
async
()
=>
{
const
{
...
...
@@ -288,7 +289,8 @@ export const useWorkflow = () => {
currentNode
.
data
=
{
...
currentNode
.
data
,
...
data
}
})
setNodes
(
newNodes
)
},
[
store
])
handleSyncWorkflowDraft
()
},
[
store
,
handleSyncWorkflowDraft
])
const
handleNodeAddNext
=
useCallback
((
currentNodeId
:
string
,
...
...
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