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
3119a444
Commit
3119a444
authored
Jul 25, 2023
by
Joel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: message error happend title show error
parent
26866fbf
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
index.tsx
...ts/explore/universal-chat/config/plugins-config/index.tsx
+1
-1
index.tsx
web/app/components/explore/universal-chat/index.tsx
+10
-4
No files found.
web/app/components/explore/universal-chat/config/plugins-config/index.tsx
View file @
3119a444
...
@@ -78,7 +78,7 @@ const Plugins: FC<IPluginsProps> = ({
...
@@ -78,7 +78,7 @@ const Plugins: FC<IPluginsProps> = ({
>
>
{
isLoading
{
isLoading
?
(
?
(
<
div
className=
'flex items-center h-[
200
px]'
>
<
div
className=
'flex items-center h-[
166
px]'
>
<
Loading
type=
'area'
/>
<
Loading
type=
'area'
/>
</
div
>
</
div
>
)
)
...
...
web/app/components/explore/universal-chat/index.tsx
View file @
3119a444
...
@@ -235,11 +235,14 @@ const Main: FC<IMainProps> = () => {
...
@@ -235,11 +235,14 @@ const Main: FC<IMainProps> = () => {
})
})
})
})
setChatList
(
newChatList
)
setChatList
(
newChatList
)
setErrorHappened
(
false
)
})
})
}
}
if
(
isNewConversation
)
if
(
isNewConversation
)
{
setChatList
(
generateNewChatListWithOpenstatement
())
setChatList
(
generateNewChatListWithOpenstatement
())
setErrorHappened
(
false
)
}
setControlFocus
(
Date
.
now
())
setControlFocus
(
Date
.
now
())
}
}
...
@@ -405,7 +408,7 @@ const Main: FC<IMainProps> = () => {
...
@@ -405,7 +408,7 @@ const Main: FC<IMainProps> = () => {
const
[
suggestQuestions
,
setSuggestQuestions
]
=
useState
<
string
[]
>
([])
const
[
suggestQuestions
,
setSuggestQuestions
]
=
useState
<
string
[]
>
([])
const
[
messageTaskId
,
setMessageTaskId
]
=
useState
(
''
)
const
[
messageTaskId
,
setMessageTaskId
]
=
useState
(
''
)
const
[
hasStopResponded
,
setHasStopResponded
,
getHasStopResponded
]
=
useGetState
(
false
)
const
[
hasStopResponded
,
setHasStopResponded
,
getHasStopResponded
]
=
useGetState
(
false
)
const
[
errorHappened
,
setErrorHappened
]
=
useState
(
false
)
const
handleSend
=
async
(
message
:
string
)
=>
{
const
handleSend
=
async
(
message
:
string
)
=>
{
if
(
isResponsing
)
{
if
(
isResponsing
)
{
notify
({
type
:
'info'
,
message
:
t
(
'appDebug.errorMessage.waitForResponse'
)
})
notify
({
type
:
'info'
,
message
:
t
(
'appDebug.errorMessage.waitForResponse'
)
})
...
@@ -462,6 +465,7 @@ const Main: FC<IMainProps> = () => {
...
@@ -462,6 +465,7 @@ const Main: FC<IMainProps> = () => {
setHasStopResponded
(
false
)
setHasStopResponded
(
false
)
setResponsingTrue
()
setResponsingTrue
()
setErrorHappened
(
false
)
setIsShowSuggestion
(
false
)
setIsShowSuggestion
(
false
)
sendChatMessage
(
data
,
{
sendChatMessage
(
data
,
{
...
@@ -521,7 +525,9 @@ const Main: FC<IMainProps> = () => {
...
@@ -521,7 +525,9 @@ const Main: FC<IMainProps> = () => {
setChatList
(
newListWithAnswer
)
setChatList
(
newListWithAnswer
)
},
},
onError
()
{
onError
()
{
setErrorHappened
(
true
)
setResponsingFalse
()
setResponsingFalse
()
// role back placeholder answer
// role back placeholder answer
setChatList
(
produce
(
getChatList
(),
(
draft
)
=>
{
setChatList
(
produce
(
getChatList
(),
(
draft
)
=>
{
draft
.
splice
(
draft
.
findIndex
(
item
=>
item
.
id
===
placeholderAnswerId
),
1
)
draft
.
splice
(
draft
.
findIndex
(
item
=>
item
.
id
===
placeholderAnswerId
),
1
)
...
@@ -625,7 +631,7 @@ const Main: FC<IMainProps> = () => {
...
@@ -625,7 +631,7 @@ const Main: FC<IMainProps> = () => {
)
)
}
>
}
>
<
div
className=
{
cn
(
doShowSuggestion
?
'pb-[140px]'
:
(
isResponsing
?
'pb-[113px]'
:
'pb-[76px]'
),
'relative grow h-[200px] mb-3.5 overflow-hidden'
)
}
>
<
div
className=
{
cn
(
doShowSuggestion
?
'pb-[140px]'
:
(
isResponsing
?
'pb-[113px]'
:
'pb-[76px]'
),
'relative grow h-[200px] mb-3.5 overflow-hidden'
)
}
>
{
(
!
isNewConversation
||
isResponsing
)
&&
(
{
(
!
isNewConversation
||
isResponsing
||
errorHappened
)
&&
(
<
div
className=
'absolute z-10 top-0 left-0 right-0 flex items-center justify-between border-b border-gray-100 mobile:h-12 tablet:h-16 px-8 bg-white'
>
<
div
className=
'absolute z-10 top-0 left-0 right-0 flex items-center justify-between border-b border-gray-100 mobile:h-12 tablet:h-16 px-8 bg-white'
>
<
div
className=
'text-gray-900'
>
{
conversationName
}
</
div
>
<
div
className=
'text-gray-900'
>
{
conversationName
}
</
div
>
<
div
className=
'flex items-center shrink-0 ml-2 space-x-2'
>
<
div
className=
'flex items-center shrink-0 ml-2 space-x-2'
>
...
@@ -637,7 +643,7 @@ const Main: FC<IMainProps> = () => {
...
@@ -637,7 +643,7 @@ const Main: FC<IMainProps> = () => {
)
}
)
}
<
div
className=
{
cn
((
!
isNewConversation
||
isResponsing
)
&&
'pt-[90px]'
,
'pc:w-[794px] max-w-full mobile:w-full mx-auto h-full overflow-y-auto'
)
}
ref=
{
chatListDomRef
}
>
<
div
className=
{
cn
((
!
isNewConversation
||
isResponsing
)
&&
'pt-[90px]'
,
'pc:w-[794px] max-w-full mobile:w-full mx-auto h-full overflow-y-auto'
)
}
ref=
{
chatListDomRef
}
>
<
Chat
<
Chat
isShowConfigElem=
{
isNewConversation
&&
!
chatList
.
some
(
item
=>
item
.
isAnswer
)
}
isShowConfigElem=
{
isNewConversation
&&
chatList
.
length
===
0
}
configElem=
{
<
Init
configElem=
{
<
Init
modelId=
{
modelId
}
modelId=
{
modelId
}
onModelChange=
{
setModeId
}
onModelChange=
{
setModeId
}
...
...
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