From 63f67ef81098bc55da83876f653b9dfd7bd57c0b Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Mon, 4 Dec 2023 14:38:24 +0100 Subject: [PATCH] Middle Header: Remove Block item for Saved Messages (#4000) --- src/components/middle/HeaderMenuContainer.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/middle/HeaderMenuContainer.tsx b/src/components/middle/HeaderMenuContainer.tsx index 60c61b656..480437f7c 100644 --- a/src/components/middle/HeaderMenuContainer.tsx +++ b/src/components/middle/HeaderMenuContainer.tsx @@ -27,6 +27,7 @@ import { selectChat, selectChatFullInfo, selectCurrentMessageList, + selectIsChatWithSelf, selectIsPremiumPurchaseBlocked, selectIsRightColumnShown, selectNotifyExceptions, selectNotifySettings, @@ -116,6 +117,7 @@ type StateProps = { canTranslate?: boolean; isBlocked?: boolean; isBot?: boolean; + isChatWithSelf?: boolean; }; const CLOSE_MENU_ANIMATION_DURATION = 200; @@ -158,6 +160,7 @@ const HeaderMenuContainer: FC = ({ canTranslate, isBlocked, isBot, + isChatWithSelf, onJoinRequestsClick, onSubscribeChannel, onSearchClick, @@ -604,7 +607,7 @@ const HeaderMenuContainer: FC = ({ {isBlocked ? lang('BotRestart') : lang('Bot.Stop')} )} - {isPrivate && !isBot && ( + {isPrivate && !isChatWithSelf && !isBot && ( ( const user = isPrivate ? selectUser(global, chatId) : undefined; const canAddContact = user && getCanAddContact(user); const isMainThread = threadId === MAIN_THREAD_ID; + const isChatWithSelf = selectIsChatWithSelf(global, chatId); const canReportChat = isMainThread && (isChatChannel(chat) || isChatGroup(chat) || (user && !user.isSelf)); const { chatId: currentChatId, threadId: currentThreadId } = selectCurrentMessageList(global) || {}; @@ -707,6 +711,7 @@ export default memo(withGlobal( canTranslate, isBlocked: userFullInfo?.isBlocked, isBot: Boolean(chatBot), + isChatWithSelf, }; }, )(HeaderMenuContainer));