Skip to content

Commit 64ccba2

Browse files
authored
Merge pull request #245 from FlowiseAI/bugfix/Sound-Received
Bugfix/prevent update last message when text is empty
2 parents 8c70ee8 + 0f9f628 commit 64ccba2

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

dist/components/Bot.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/web.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/Bot.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ export const Bot = (botProps: BotProps & { class?: string }) => {
344344
setMessages((prevMessages) => {
345345
const allMessages = [...cloneDeep(prevMessages)];
346346
if (allMessages[allMessages.length - 1].type === 'userMessage') return allMessages;
347+
if (!text) return allMessages;
347348
allMessages[allMessages.length - 1].message += text;
348349
allMessages[allMessages.length - 1].rating = undefined;
349350
if (!hasSoundPlayed) {

0 commit comments

Comments
 (0)