From 5bfba2d7cfe56e5b931ce05f78dfb8fec2cd8a10 Mon Sep 17 00:00:00 2001 From: Paul Date: Tue, 17 Aug 2021 20:05:21 +0100 Subject: [PATCH] Show friend request count in indicator. Fixes #96 --- src/components/navigation/left/ServerListSidebar.tsx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/components/navigation/left/ServerListSidebar.tsx b/src/components/navigation/left/ServerListSidebar.tsx index 08f1b55e..61784aae 100644 --- a/src/components/navigation/left/ServerListSidebar.tsx +++ b/src/components/navigation/left/ServerListSidebar.tsx @@ -251,13 +251,9 @@ export const ServerListSidebar = observer(({ unreads, lastOpened }: Props) => { } } - if ( - [...client.users.values()].find( - (x) => x.relationship === RelationshipStatus.Incoming, - ) - ) { - alertCount++; - } + alertCount += [...client.users.values()].filter( + (x) => x.relationship === RelationshipStatus.Incoming, + ).length; if (alertCount > 0) homeUnread = "mention"; const homeActive =