Skip to content
This repository has been archived by the owner on Nov 21, 2020. It is now read-only.

Commit

Permalink
fix(conversation): read conversation becoming unread sometimes
Browse files Browse the repository at this point in the history
close #664
  • Loading branch information
batamar committed Dec 5, 2019
1 parent efefb6a commit a6b1254
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/db/models/Conversations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,8 @@ export const loadClass = () => {

// if current user is not in read users list then add it
if (!readUserIds.includes(userId)) {
await Conversations.updateConversation(_id, { readUserIds: userId });
readUserIds.push(userId);
await Conversations.updateConversation(_id, { readUserIds });
}

return Conversations.findOne({ _id });
Expand Down

0 comments on commit a6b1254

Please sign in to comment.