[FIX] Thread view in a channel user haven't joined (#19172)

pull/19179/head
Douglas Fabris 5 years ago committed by GitHub
parent 67b3f5f7f2
commit 1dd744e58e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      app/threads/server/functions.js

@ -70,7 +70,9 @@ export const unfollow = ({ tmid, rid, uid }) => {
export const readThread = ({ userId, rid, tmid }) => {
const fields = { tunread: 1 };
const sub = Subscriptions.findOneByRoomIdAndUserId(rid, userId, { fields });
if (!sub) {
return;
}
// if the thread being marked as read is the last one unread also clear the unread subscription flag
const clearAlert = sub.tunread?.length <= 1 && sub.tunread.includes(tmid);

Loading…
Cancel
Save