From 2aa94c88dccd069389e6885c6b9d1fbd3170cba2 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Thu, 15 Apr 2021 00:28:47 +0300 Subject: [PATCH] Recent Chats: Fix broken UI for users with no first name --- src/components/left/search/RecentContacts.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/left/search/RecentContacts.tsx b/src/components/left/search/RecentContacts.tsx index a4d4662aa..c362e7522 100644 --- a/src/components/left/search/RecentContacts.tsx +++ b/src/components/left/search/RecentContacts.tsx @@ -34,6 +34,8 @@ type DispatchProps = Pick; const SEARCH_CLOSE_TIMEOUT_MS = 250; +const NBSP = '\u00A0'; + const runThrottled = throttle((cb) => cb(), 60000, true); const RecentContacts: FC = ({ @@ -77,7 +79,7 @@ const RecentContacts: FC = ({ {topUserIds.map((userId) => (
handleClick(userId)}> -
{renderText(getUserFirstName(usersById[userId])!)}
+
{renderText(getUserFirstName(usersById[userId]) || NBSP)}
))}