Middle Header: Remove Block item for Saved Messages (#4000)
This commit is contained in:
parent
82af54555c
commit
63f67ef810
@ -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<OwnProps & StateProps> = ({
|
||||
canTranslate,
|
||||
isBlocked,
|
||||
isBot,
|
||||
isChatWithSelf,
|
||||
onJoinRequestsClick,
|
||||
onSubscribeChannel,
|
||||
onSearchClick,
|
||||
@ -604,7 +607,7 @@ const HeaderMenuContainer: FC<OwnProps & StateProps> = ({
|
||||
{isBlocked ? lang('BotRestart') : lang('Bot.Stop')}
|
||||
</MenuItem>
|
||||
)}
|
||||
{isPrivate && !isBot && (
|
||||
{isPrivate && !isChatWithSelf && !isBot && (
|
||||
<MenuItem
|
||||
icon={isBlocked ? 'user' : 'hand-stop'}
|
||||
onClick={isBlocked ? handleUnblock : handleBlock}
|
||||
@ -665,6 +668,7 @@ export default memo(withGlobal<OwnProps>(
|
||||
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<OwnProps>(
|
||||
canTranslate,
|
||||
isBlocked: userFullInfo?.isBlocked,
|
||||
isBot: Boolean(chatBot),
|
||||
isChatWithSelf,
|
||||
};
|
||||
},
|
||||
)(HeaderMenuContainer));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user