Ensure deleted chats don't count towards unread (#4129)

This commit is contained in:
Eric Bailey
2024-05-20 17:19:01 -05:00
committed by GitHub
parent e98bf6521b
commit 22522090c2
@@ -59,7 +59,10 @@ export function useUnreadMessageCount() {
// TODO could shadow this outside this hook and get optimistic block state
const moderation = moderateProfile(otherMember, moderationOpts)
const shouldIgnore = convo.muted || moderation.blocked
const shouldIgnore =
convo.muted ||
moderation.blocked ||
otherMember.did === 'missing.invalid'
const unreadCount = !shouldIgnore && convo.unreadCount > 0 ? 1 : 0
return acc + unreadCount