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
5f2a40d6
Commit
5f2a40d6
authored
Jul 25, 2023
by
Joel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: not show loading
parent
9be4b804
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
5 deletions
+3
-5
index.tsx
web/app/components/app/chat/index.tsx
+1
-1
index.tsx
web/app/components/app/chat/thought/index.tsx
+1
-1
index.tsx
web/app/components/explore/universal-chat/index.tsx
+1
-3
No files found.
web/app/components/app/chat/index.tsx
View file @
5f2a40d6
...
@@ -161,7 +161,7 @@ const Chat: FC<IChatProps> = ({
...
@@ -161,7 +161,7 @@ const Chat: FC<IChatProps> = ({
if
(
item
.
isAnswer
)
{
if
(
item
.
isAnswer
)
{
const
isLast
=
item
.
id
===
chatList
[
chatList
.
length
-
1
].
id
const
isLast
=
item
.
id
===
chatList
[
chatList
.
length
-
1
].
id
const
thoughts
=
item
.
agent_thoughts
?.
filter
(
item
=>
item
.
thought
!==
'[DONE]'
)
const
thoughts
=
item
.
agent_thoughts
?.
filter
(
item
=>
item
.
thought
!==
'[DONE]'
)
const
isThinking
=
item
.
agent_thoughts
&&
item
.
agent_thoughts
?.
length
>
0
&&
!
item
.
agent_thoughts
.
find
(
item
=>
item
.
thought
!
==
'[DONE]'
)
const
isThinking
=
item
.
agent_thoughts
&&
item
.
agent_thoughts
?.
length
>
0
&&
!
item
.
agent_thoughts
.
some
(
item
=>
item
.
thought
=
==
'[DONE]'
)
return
<
Answer
return
<
Answer
key=
{
item
.
id
}
key=
{
item
.
id
}
item=
{
item
}
item=
{
item
}
...
...
web/app/components/app/chat/thought/index.tsx
View file @
5f2a40d6
...
@@ -70,7 +70,7 @@ const Thought: FC<IThoughtProps> = ({
...
@@ -70,7 +70,7 @@ const Thought: FC<IThoughtProps> = ({
<
div
className=
'flex items-center h-6 space-x-1 cursor-pointer'
onClick=
{
()
=>
setIsShowDetail
(
!
isShowDetail
)
}
>
<
div
className=
'flex items-center h-6 space-x-1 cursor-pointer'
onClick=
{
()
=>
setIsShowDetail
(
!
isShowDetail
)
}
>
{
!
isThinking
?
<
ThoughtList
/>
:
<
div
className=
'animate-spin'
><
LodingIcon
/></
div
>
}
{
!
isThinking
?
<
ThoughtList
/>
:
<
div
className=
'animate-spin'
><
LodingIcon
/></
div
>
}
<
div
dangerouslySetInnerHTML=
{
{
<
div
dangerouslySetInnerHTML=
{
{
__html
:
isThinking
?
getThoughtText
(
list
[
0
])
:
(
t
(
`explore.universalChat.thought.${isShowDetail ? 'hide' : 'show'}`
)
+
t
(
'explore.universalChat.thought.processOfThought'
)),
__html
:
isThinking
?
getThoughtText
(
list
[
list
.
length
-
1
])
:
(
t
(
`explore.universalChat.thought.${isShowDetail ? 'hide' : 'show'}`
)
+
t
(
'explore.universalChat.thought.processOfThought'
)),
}
}
}
}
></
div
>
></
div
>
<
ChevronDown
className=
{
isShowDetail
?
'rotate-180'
:
''
}
/>
<
ChevronDown
className=
{
isShowDetail
?
'rotate-180'
:
''
}
/>
...
...
web/app/components/explore/universal-chat/index.tsx
View file @
5f2a40d6
...
@@ -510,10 +510,8 @@ const Main: FC<IMainProps> = () => {
...
@@ -510,10 +510,8 @@ const Main: FC<IMainProps> = () => {
}
}
},
},
onThought
(
thought
)
{
onThought
(
thought
)
{
if
(
thought
.
thought
===
'[DONE]'
)
return
responseItem
.
id
=
thought
.
message_id
;
// thought finished then start to return message. Warning: use push agent_thoughts.push would caused problem when the thought is more then 2
// thought finished then start to return message. Warning: use push agent_thoughts.push would caused problem when the thought is more then 2
responseItem
.
id
=
thought
.
message_id
;
(
responseItem
as
any
).
agent_thoughts
=
[...(
responseItem
as
any
).
agent_thoughts
,
thought
]
// .push(thought)
(
responseItem
as
any
).
agent_thoughts
=
[...(
responseItem
as
any
).
agent_thoughts
,
thought
]
// .push(thought)
const
newListWithAnswer
=
produce
(
const
newListWithAnswer
=
produce
(
getChatList
().
filter
(
item
=>
item
.
id
!==
responseItem
.
id
&&
item
.
id
!==
placeholderAnswerId
),
getChatList
().
filter
(
item
=>
item
.
id
!==
responseItem
.
id
&&
item
.
id
!==
placeholderAnswerId
),
...
...
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