Bugfix/Allow empty uploads of images (#3135)

allow empty uploads of images
This commit is contained in:
Henry Heng
2024-09-03 17:29:25 +01:00
committed by GitHub
parent 66a603f294
commit 2a21f18bf8
@@ -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
}
}