From 961736cfb467d777de667e05ba7457471b71fbd2 Mon Sep 17 00:00:00 2001 From: zubiden <19638254+zubiden@users.noreply.github.com> Date: Tue, 9 Sep 2025 20:26:18 +0200 Subject: [PATCH] Settings: Always show autoarchive option for premium users (#6199) --- src/api/types/misc.ts | 2 +- src/components/left/settings/SettingsPrivacy.tsx | 5 +++-- src/limits.ts | 1 - 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/api/types/misc.ts b/src/api/types/misc.ts index ac47af004..a2b4d5709 100644 --- a/src/api/types/misc.ts +++ b/src/api/types/misc.ts @@ -220,7 +220,7 @@ export interface ApiAppConfig { topicsPinnedLimit: number; hiddenMembersMinCount: number; limits: Record; - canDisplayAutoarchiveSetting: boolean; + canDisplayAutoarchiveSetting?: boolean; storyViewersExpirePeriod: number; storyChangelogUserId: string; maxPinnedStoriesCount: number; diff --git a/src/components/left/settings/SettingsPrivacy.tsx b/src/components/left/settings/SettingsPrivacy.tsx index 7e946c983..422b217ce 100644 --- a/src/components/left/settings/SettingsPrivacy.tsx +++ b/src/components/left/settings/SettingsPrivacy.tsx @@ -481,15 +481,16 @@ export default memo(withGlobal( const { canDisplayChatInTitle } = selectSharedSettings(global); const shouldChargeForMessages = Boolean(nonContactPeersPaidStars); const isCurrentUserFrozen = selectIsCurrentUserFrozen(global); + const isCurrentUserPremium = selectIsCurrentUserPremium(global); return { - isCurrentUserPremium: selectIsCurrentUserPremium(global), + isCurrentUserPremium, hasPassword, hasPasscode: Boolean(hasPasscode), blockedCount: blocked.totalCount, webAuthCount: global.activeWebSessions.orderedHashes.length, isSensitiveEnabled, - canDisplayAutoarchiveSetting: Boolean(appConfig.canDisplayAutoarchiveSetting), + canDisplayAutoarchiveSetting: appConfig.canDisplayAutoarchiveSetting || isCurrentUserPremium, shouldArchiveAndMuteNewNonContact, canChangeSensitive, shouldNewNonContactPeersRequirePremium, diff --git a/src/limits.ts b/src/limits.ts index 7e32e2aec..c8fa04d34 100644 --- a/src/limits.ts +++ b/src/limits.ts @@ -58,7 +58,6 @@ export const DEFAULT_APP_CONFIG: ApiAppConfig = { moreAccounts: DEFAULT_LIMITS.moreAccounts, maxReactions: DEFAULT_LIMITS.maxReactions, }, - canDisplayAutoarchiveSetting: true, autologinDomains: [ 'instantview.telegram.org', 'translations.telegram.org',