From 2a21f18bf8b1ead105790d3beac34b989069c65f Mon Sep 17 00:00:00 2001 From: Henry Heng Date: Tue, 3 Sep 2024 17:29:25 +0100 Subject: [PATCH] Bugfix/Allow empty uploads of images (#3135) allow empty uploads of images --- packages/ui/src/views/chatmessage/ChatMessage.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/ui/src/views/chatmessage/ChatMessage.jsx b/packages/ui/src/views/chatmessage/ChatMessage.jsx index df6d4b9dca8..294352055eb 100644 --- a/packages/ui/src/views/chatmessage/ChatMessage.jsx +++ b/packages/ui/src/views/chatmessage/ChatMessage.jsx @@ -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 } }