Skip to content

Commit

Permalink
Merge pull request #126 from dominikkawka/playgroundChatClear
Browse files Browse the repository at this point in the history
UI Crash on clear chat button fix
  • Loading branch information
vishnoianil authored Aug 21, 2024
2 parents 6593164 + 397c49d commit 652c9df
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/app/playground/chat/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,9 @@ const ChatPage: React.FC = () => {

setMessages((messages) => {
const updatedMessages = [...messages];
updatedMessages[updatedMessages.length - 1].text = botMessage;
if (updatedMessages.length > 1) {
updatedMessages[updatedMessages.length - 1].text = botMessage;
}
return updatedMessages;
});
}
Expand Down

0 comments on commit 652c9df

Please sign in to comment.