From 04754af53a5448defd5b798c50f3b25ba6ec01a8 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Fri, 19 Nov 2021 03:22:24 +0300 Subject: [PATCH] Profile: Do not show common chats for bots and Saved Messages (#1550) --- src/components/right/Profile.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/right/Profile.tsx b/src/components/right/Profile.tsx index dc17bb63..5e16d644 100644 --- a/src/components/right/Profile.tsx +++ b/src/components/right/Profile.tsx @@ -23,7 +23,7 @@ import { } from '../../config'; import { IS_TOUCH_ENV } from '../../util/environment'; import { - getHasAdminRight, isChatAdmin, isChatChannel, isChatGroup, isUserId, + getHasAdminRight, isChatAdmin, isChatChannel, isChatGroup, isUserBot, isUserId, } from '../../modules/helpers'; import { selectChatMessages, @@ -500,6 +500,7 @@ export default memo(withGlobal( const activeDownloadIds = selectActiveDownloadIds(global, chatId); + let hasCommonChatsTab; let resolvedUserId; let user; if (userId) { @@ -507,9 +508,9 @@ export default memo(withGlobal( } else if (isUserId(chatId)) { resolvedUserId = chatId; } - const hasCommonChatsTab = Boolean(resolvedUserId); if (resolvedUserId) { user = selectUser(global, resolvedUserId); + hasCommonChatsTab = user && !user.isSelf && !isUserBot(user); } return {