Skip to content

Commit

Permalink
Fixed counting deleted messages as unread #909
Browse files Browse the repository at this point in the history
  • Loading branch information
devopvoid committed May 23, 2024
1 parent 4929603 commit 3ddc196
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/component/chat-form/chat-form.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ form .recipient-container {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 0px 0.75rem;
gap: 0 0.75rem;
}
form .message-container {
display: flex;
Expand Down
2 changes: 1 addition & 1 deletion src/store/chat.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class ChatStore {
}

get unreadMessages() {
return this.messages.reduce((unread, message) => message.read ? unread : ++unread, 0);
return this.messages.reduce((unread, message) => message.read || message.deleted ? unread : ++unread, 0);
}

getMessageById(messageId: string) : ChatMessage | undefined {
Expand Down

0 comments on commit 3ddc196

Please sign in to comment.