From f3786e473b66e582ff00989d83736a29ae40dc75 Mon Sep 17 00:00:00 2001 From: Ryan Alexander Date: Sun, 29 Aug 2021 10:29:58 +1000 Subject: [PATCH] Treat direct messages as mention, group behaviour is the same --- .../navigation/left/ServerListSidebar.tsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/components/navigation/left/ServerListSidebar.tsx b/src/components/navigation/left/ServerListSidebar.tsx index 61784aae..a4fef41d 100644 --- a/src/components/navigation/left/ServerListSidebar.tsx +++ b/src/components/navigation/left/ServerListSidebar.tsx @@ -240,15 +240,16 @@ export const ServerListSidebar = observer(({ unreads, lastOpened }: Props) => { let homeUnread: "mention" | "unread" | undefined; let alertCount = 0; for (const x of channels) { - if ( - (x.channel?.channel_type === "DirectMessage" - ? x.channel?.active - : x.channel?.channel_type === "Group") && - x.unread - ) { + if (x.channel?.channel_type === "Group" && x.unread) { homeUnread = "unread"; alertCount += x.alertCount ?? 0; } + if ( + x.channel?.channel_type === "DirectMessage" && + x.unread && + x.unread.length > 0 + ) + alertCount++; } alertCount += [...client.users.values()].filter(