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
1c5d0787
Commit
1c5d0787
authored
Mar 13, 2024
by
StyleZhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hooks
parent
e11fc8c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
use-workflow.ts
web/app/components/workflow/hooks/use-workflow.ts
+10
-8
No files found.
web/app/components/workflow/hooks/use-workflow.ts
View file @
1c5d0787
...
...
@@ -93,13 +93,15 @@ export const useWorkflow = () => {
return
list
const
traverse
=
(
root
:
Node
,
callback
:
(
node
:
Node
)
=>
void
)
=>
{
const
incomers
=
getIncomers
(
root
,
nodes
,
edges
)
if
(
incomers
.
length
)
{
incomers
.
forEach
((
node
)
=>
{
callback
(
node
)
traverse
(
node
,
callback
)
})
if
(
root
)
{
const
incomers
=
getIncomers
(
root
,
nodes
,
edges
)
if
(
incomers
.
length
)
{
incomers
.
forEach
((
node
)
=>
{
callback
(
node
)
traverse
(
node
,
callback
)
})
}
}
}
traverse
(
currentNode
,
(
node
)
=>
{
...
...
@@ -107,7 +109,7 @@ export const useWorkflow = () => {
})
const
length
=
list
.
length
if
(
length
&&
list
.
some
(
item
=>
item
.
data
.
type
===
BlockEnum
.
Start
)
)
{
if
(
length
)
{
return
list
.
reverse
().
filter
((
item
)
=>
{
return
SUPPORT_OUTPUT_VARS_NODE
.
includes
(
item
.
data
.
type
)
})
...
...
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