From 2ddd454ef2c967d7b325980f037e4af1768d885c Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Thu, 15 Dec 2022 19:19:36 +0100 Subject: [PATCH] Profile: Fix duplicated usernames (#2212) --- src/components/common/ChatExtra.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/common/ChatExtra.tsx b/src/components/common/ChatExtra.tsx index 1077728f4..2175aeb7a 100644 --- a/src/components/common/ChatExtra.tsx +++ b/src/components/common/ChatExtra.tsx @@ -80,10 +80,10 @@ const ChatExtra: FC = ({ return result?.length ? result : undefined; }, [usernames]); const activeChatUsernames = useMemo(() => { - const result = chatUsernames?.filter((u) => u.isActive); + const result = !user ? chatUsernames?.filter((u) => u.isActive) : undefined; return result?.length ? result : undefined; - }, [chatUsernames]); + }, [chatUsernames, user]); const link = useMemo(() => (chat ? getChatLink(chat) : undefined), [chat]); const handleNotificationChange = useCallback(() => {