Merge pull request #1528 from thecodingmachine/api_chat_multiple_virtual_users

When there are many virtual users (generated by chat), only the name of a first user is displayed.
This commit is contained in:
David Négrier 2021-10-18 15:02:21 +02:00 committed by GitHub
commit b6d571500e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 10 deletions

View file

@ -84,7 +84,7 @@ function createChatMessagesStore() {
addExternalMessage(authorId: number, text: string) {
update((list) => {
const lastMessage = list[list.length - 1];
if (lastMessage && lastMessage.type === ChatMessageTypes.text && lastMessage.text) {
if (lastMessage && lastMessage.type === ChatMessageTypes.text && lastMessage.text && lastMessage?.author?.userId === authorId) {
lastMessage.text.push(text);
} else {
list.push({