Skip to content

Commit

Permalink
Merge pull request FlowiseAI#245 from FlowiseAI/bugfix/Sound-Received
Browse files Browse the repository at this point in the history
Bugfix/prevent update last message when text is empty
  • Loading branch information
HenryHengZJ authored Sep 18, 2024
2 parents 8c70ee8 + 0f9f628 commit 64ccba2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dist/components/Bot.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/web.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/components/Bot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ export const Bot = (botProps: BotProps & { class?: string }) => {
setMessages((prevMessages) => {
const allMessages = [...cloneDeep(prevMessages)];
if (allMessages[allMessages.length - 1].type === 'userMessage') return allMessages;
if (!text) return allMessages;
allMessages[allMessages.length - 1].message += text;
allMessages[allMessages.length - 1].rating = undefined;
if (!hasSoundPlayed) {
Expand Down

0 comments on commit 64ccba2

Please sign in to comment.