Fixing chat message attributed to wrong user
When a new user entered a chat message, the message was still attributed to the last user who wrote.
This commit is contained in:
parent
f8b506144d
commit
4a40c08578
2 changed files with 2 additions and 1 deletions
|
@ -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({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue