Fix audio recording not sending when recording stops

This commit is contained in:
Ilango
2024-02-13 16:23:12 +05:30
parent 0a54db71c1
commit 11219c6549
@@ -353,7 +353,7 @@ export const ChatMessage = ({ open, chatflowid, isDialog, previews, setPreviews
if (!promptStarterInput && userInput.trim() === '') {
const containsAudio = previews.filter((item) => item.type === 'audio').length > 0
if (!(previews.length > 1 && containsAudio)) {
if (!(previews.length >= 1 && containsAudio)) {
return
}
}
@@ -585,7 +585,7 @@ export const ChatMessage = ({ open, chatflowid, isDialog, previews, setPreviews
useEffect(() => {
// wait for audio recording to load and then send
const containsAudio = previews.filter((item) => item.type === 'audio').length > 0
if (previews.length > 1 && containsAudio) {
if (previews.length >= 1 && containsAudio) {
setIsRecording(false)
setRecordingNotSupported(false)
handlePromptClick('')