Add setting for "keep muted chats archived"

This commit is contained in:
yash-signal
2025-08-12 08:50:25 -05:00
committed by GitHub
parent b798a4f927
commit a455275d01
4 changed files with 31 additions and 0 deletions

View File

@@ -7004,6 +7004,14 @@
"messageformat": "For example, :-) will be converted to <emojify>🙂</emojify>",
"description": "Description for the auto convert emoji setting"
},
"icu:Preferences__keep-muted-chats-archived--title": {
"messageformat": "Keep muted chats archived",
"description": "Title for the setting that prevents muted chats from being unarchived when new messages arrive"
},
"icu:Preferences__keep-muted-chats-archived--description": {
"messageformat": "Muted chats that are archived will remain archived when a new message arrives.",
"description": "Description for the setting that prevents muted chats from being unarchived"
},
"icu:Preferences--advanced": {
"messageformat": "Advanced",
"description": "Title for advanced settings"

View File

@@ -323,6 +323,7 @@ export default {
hasStoriesDisabled: false,
hasTextFormatting: true,
hasTypingIndicators: true,
hasKeepMutedChatsArchived: false,
initialSpellCheckSetting: true,
isAutoDownloadUpdatesSupported: true,
isAutoLaunchSupported: true,
@@ -428,6 +429,7 @@ export default {
onIncomingCallNotificationsChange: action(
'onIncomingCallNotificationsChange'
),
onKeepMutedChatsArchivedChange: action('onKeepMutedChatsArchivedChange'),
onLocaleChange: action('onLocaleChange'),
onLastSyncTimeChange: action('onLastSyncTimeChange'),
onMediaCameraPermissionsChange: action('onMediaCameraPermissionsChange'),

View File

@@ -154,6 +154,7 @@ export type PropsDataType = {
hasStoriesDisabled: boolean;
hasTextFormatting: boolean;
hasTypingIndicators: boolean;
hasKeepMutedChatsArchived: boolean;
page: SettingsPage;
lastSyncTime?: number;
notificationContent: NotificationSettingType;
@@ -287,6 +288,7 @@ type PropsFunctionType = {
onHasStoriesDisabledChanged: SelectChangeHandlerType<boolean>;
onHideMenuBarChange: CheckboxChangeHandlerType;
onIncomingCallNotificationsChange: CheckboxChangeHandlerType;
onKeepMutedChatsArchivedChange: CheckboxChangeHandlerType;
onLastSyncTimeChange: (time: number) => unknown;
onLocaleChange: (locale: string | null | undefined) => void;
onMediaCameraPermissionsChange: CheckboxChangeHandlerType;
@@ -413,6 +415,7 @@ export function Preferences({
hasStoriesDisabled,
hasTextFormatting,
hasTypingIndicators,
hasKeepMutedChatsArchived,
i18n,
initialSpellCheckSetting,
isAutoDownloadUpdatesSupported,
@@ -445,6 +448,7 @@ export function Preferences({
onHasStoriesDisabledChanged,
onHideMenuBarChange,
onIncomingCallNotificationsChange,
onKeepMutedChatsArchivedChange,
onLastSyncTimeChange,
onLocaleChange,
onMediaCameraPermissionsChange,
@@ -1167,6 +1171,16 @@ export function Preferences({
name="autoConvertEmoji"
onChange={onAutoConvertEmojiChange}
/>
<Checkbox
checked={hasKeepMutedChatsArchived}
description={i18n(
'icu:Preferences__keep-muted-chats-archived--description'
)}
label={i18n('icu:Preferences__keep-muted-chats-archived--title')}
moduleClassName="Preferences__checkbox"
name="keepMutedChatsArchived"
onChange={onKeepMutedChatsArchivedChange}
/>
<SettingsRow>
<Control
left={i18n('icu:Preferences__EmojiSkinToneDefaultSetting__Label')}

View File

@@ -563,6 +563,11 @@ export function SmartPreferences(): JSX.Element | null {
'autoConvertEmoji',
true
);
const [hasKeepMutedChatsArchived, onKeepMutedChatsArchivedChange] =
createItemsAccess('keepMutedChatsArchived', false, () => {
const account = window.ConversationController.getOurConversationOrThrow();
account.captureChange('keepMutedChatsArchived');
});
const [hasAutoDownloadUpdate, onAutoDownloadUpdateChange] = createItemsAccess(
'auto-download-update',
true
@@ -754,6 +759,7 @@ export function SmartPreferences(): JSX.Element | null {
hasAutoConvertEmoji={hasAutoConvertEmoji}
hasAutoDownloadUpdate={hasAutoDownloadUpdate}
hasAutoLaunch={hasAutoLaunch}
hasKeepMutedChatsArchived={hasKeepMutedChatsArchived}
hasCallNotifications={hasCallNotifications}
hasCallRingtoneNotification={hasCallRingtoneNotification}
hasContentProtection={hasContentProtection}
@@ -810,6 +816,7 @@ export function SmartPreferences(): JSX.Element | null {
onHasStoriesDisabledChanged={onHasStoriesDisabledChanged}
onHideMenuBarChange={onHideMenuBarChange}
onIncomingCallNotificationsChange={onIncomingCallNotificationsChange}
onKeepMutedChatsArchivedChange={onKeepMutedChatsArchivedChange}
onLastSyncTimeChange={onLastSyncTimeChange}
onLocaleChange={onLocaleChange}
onMediaCameraPermissionsChange={onMediaCameraPermissionsChange}