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
805ed84f
Unverified
Commit
805ed84f
authored
Feb 05, 2024
by
zxhlyh
Committed by
GitHub
Feb 05, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: enchange pic uploading tip (#2388)
Co-authored-by:
Joel
<
iamjoel007@gmail.com
>
parent
5010706d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
7 deletions
+16
-7
chat-input.tsx
web/app/components/base/chat/chat/chat-input.tsx
+9
-4
hooks.ts
web/app/components/base/chat/chat/hooks.ts
+1
-2
index.tsx
web/app/components/share/text-generation/result/index.tsx
+6
-1
No files found.
web/app/components/base/chat/chat/chat-input.tsx
View file @
805ed84f
...
...
@@ -62,6 +62,14 @@ const ChatInput: FC<ChatInputProps> = ({
const
handleSend
=
()
=>
{
if
(
onSend
)
{
if
(
files
.
find
(
item
=>
item
.
type
===
TransferMethod
.
local_file
&&
!
item
.
fileId
))
{
notify
({
type
:
'info'
,
message
:
t
(
'appDebug.errorMessage.waitForImgUpload'
)
})
return
}
if
(
!
query
||
!
query
.
trim
())
{
notify
({
type
:
'info'
,
message
:
t
(
'appAnnotation.errorMessage.queryRequired'
)
})
return
}
onSend
(
query
,
files
.
filter
(
file
=>
file
.
progress
!==
-
1
).
map
(
fileItem
=>
({
type
:
'image'
,
transfer_method
:
fileItem
.
type
,
...
...
@@ -69,9 +77,6 @@ const ChatInput: FC<ChatInputProps> = ({
upload_file_id
:
fileItem
.
fileId
,
})))
setQuery
(
''
)
}
if
(
!
files
.
find
(
item
=>
item
.
type
===
TransferMethod
.
local_file
&&
!
item
.
fileId
))
{
if
(
files
.
length
)
onClear
()
}
}
...
...
web/app/components/base/chat/chat/hooks.ts
View file @
805ed84f
...
...
@@ -189,8 +189,7 @@ export const useChat = (
}:
SendCallback
,
)
=>
{
setSuggestQuestions
([])
if
(
!
data
.
query
||
!
data
.
query
.
trim
())
return
if
(
isResponsingRef
.
current
)
{
notify
({
type
:
'info'
,
message
:
t
(
'appDebug.errorMessage.waitForResponse'
)
})
return
false
...
...
web/app/components/share/text-generation/result/index.tsx
View file @
805ed84f
...
...
@@ -96,8 +96,13 @@ const Result: FC<IResultProps> = ({
return
true
const
prompt_variables
=
promptConfig
?.
prompt_variables
if
(
!
prompt_variables
||
prompt_variables
?.
length
===
0
)
if
(
!
prompt_variables
||
prompt_variables
?.
length
===
0
)
{
if
(
completionFiles
.
find
(
item
=>
item
.
transfer_method
===
TransferMethod
.
local_file
&&
!
item
.
upload_file_id
))
{
notify
({
type
:
'info'
,
message
:
t
(
'appDebug.errorMessage.waitForImgUpload'
)
})
return
false
}
return
true
}
let
hasEmptyInput
=
''
const
requiredVars
=
prompt_variables
?.
filter
(({
key
,
name
,
required
})
=>
{
...
...
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