Settings: Remove Saved Messages button (#4304)

This commit is contained in:
Alexander Zinchuk 2024-02-23 14:06:22 +01:00
parent 75015792be
commit f4b863a419
2 changed files with 6 additions and 6 deletions

View File

@ -44,7 +44,7 @@ import Switcher from '../ui/Switcher';
type OwnProps = { type OwnProps = {
chatOrUserId: string; chatOrUserId: string;
isSavedDialog?: boolean; isSavedDialog?: boolean;
forceShowSelf?: boolean; isInSettings?: boolean;
}; };
type StateProps = type StateProps =
@ -67,7 +67,7 @@ const ChatExtra: FC<OwnProps & StateProps> = ({
chatOrUserId, chatOrUserId,
user, user,
chat, chat,
forceShowSelf, isInSettings,
canInviteUsers, canInviteUsers,
isMuted, isMuted,
phoneCodeList, phoneCodeList,
@ -160,7 +160,7 @@ const ChatExtra: FC<OwnProps & StateProps> = ({
openSavedDialog({ chatId: chatOrUserId }); openSavedDialog({ chatId: chatOrUserId });
}); });
if (!chat || chat.isRestricted || (isSelf && !forceShowSelf)) { if (!chat || chat.isRestricted || (isSelf && !isInSettings)) {
return undefined; return undefined;
} }
@ -262,7 +262,7 @@ const ChatExtra: FC<OwnProps & StateProps> = ({
<span className="subtitle">{lang('SetUrlPlaceholder')}</span> <span className="subtitle">{lang('SetUrlPlaceholder')}</span>
</ListItem> </ListItem>
)} )}
{!forceShowSelf && ( {!isInSettings && (
<ListItem icon="unmute" ripple onClick={handleNotificationChange}> <ListItem icon="unmute" ripple onClick={handleNotificationChange}>
<span>{lang('Notifications')}</span> <span>{lang('Notifications')}</span>
<Switcher <Switcher
@ -273,7 +273,7 @@ const ChatExtra: FC<OwnProps & StateProps> = ({
/> />
</ListItem> </ListItem>
)} )}
{hasSavedMessages && ( {hasSavedMessages && !isInSettings && (
<ListItem icon="saved-messages" ripple onClick={handleOpenSavedDialog}> <ListItem icon="saved-messages" ripple onClick={handleOpenSavedDialog}>
<span>{lang('SavedMessagesTab')}</span> <span>{lang('SavedMessagesTab')}</span>
</ListItem> </ListItem>

View File

@ -78,7 +78,7 @@ const SettingsMain: FC<OwnProps & StateProps> = ({
{currentUserId && ( {currentUserId && (
<ChatExtra <ChatExtra
chatOrUserId={currentUserId} chatOrUserId={currentUserId}
forceShowSelf isInSettings
/> />
)} )}
<ListItem <ListItem