Skip to content

Commit

Permalink
Bugfix/Allow empty uploads of images (#3135)
Browse files Browse the repository at this point in the history
allow empty uploads of images
  • Loading branch information
HenryHengZJ authored Sep 3, 2024
1 parent 66a603f commit 2a21f18
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/ui/src/views/chatmessage/ChatMessage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -619,8 +619,8 @@ export const ChatMessage = ({ open, chatflowid, isAgentCanvas, isDialog, preview
if (e) e.preventDefault()

if (!selectedInput && userInput.trim() === '') {
const containsAudio = previews.filter((item) => item.type === 'audio').length > 0
if (!(previews.length >= 1 && containsAudio)) {
const containsFile = previews.filter((item) => !item.mime.startsWith('image') && item.type !== 'audio').length > 0
if (!previews.length || (previews.length && containsFile)) {
return
}
}
Expand Down

0 comments on commit 2a21f18

Please sign in to comment.