Skip to content

Commit

Permalink
Fixing chat message attributed to wrong user
Browse files Browse the repository at this point in the history
When a new user entered a chat message, the message was still attributed to the last user who wrote.
  • Loading branch information
moufmouf committed Oct 18, 2021
1 parent f8b5061 commit 4a40c08
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- Moving a discussion over a user will now add this user to the discussion
- Being in a silent zone new forces mediaConstraints to false (#1508)
- Fixes for the emote menu (#1501)
- Fixing chat message attributed to wrong user (#1507 #1528)

## Version 1.5.0
### Updates
Expand Down
2 changes: 1 addition & 1 deletion front/src/Stores/ChatStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit 4a40c08

Please sign in to comment.