diff --git a/src/components/left/settings/SettingsGeneral.tsx b/src/components/left/settings/SettingsGeneral.tsx index 2e3e4e13e..413f7dba9 100644 --- a/src/components/left/settings/SettingsGeneral.tsx +++ b/src/components/left/settings/SettingsGeneral.tsx @@ -35,16 +35,14 @@ type StateProps = Pick & { stickerSetIds?: string[]; stickerSetsById?: Record; }; type DispatchProps = Pick; const ANIMATION_LEVEL_OPTIONS = [ @@ -68,13 +66,9 @@ const SettingsGeneral: FC = ({ shouldAutoPlayVideos, shouldSuggestStickers, shouldLoopStickers, - isSensitiveEnabled, - canChangeSensitive, setSettingOption, loadStickerSets, loadAddedStickers, - loadContentSettings, - updateContentSettings, }) => { // eslint-disable-next-line no-null/no-null const stickerSettingsRef = useRef(null); @@ -95,8 +89,7 @@ const SettingsGeneral: FC = ({ useEffect(() => { loadStickerSets(); - loadContentSettings(); - }, [loadContentSettings, loadStickerSets]); + }, [loadStickerSets]); useEffect(() => { if (stickerSetIds && stickerSetIds.length) { @@ -176,19 +169,6 @@ const SettingsGeneral: FC = ({ )} -
-

- {lang('lng_settings_sensitive_title')} -

- -
-

{lang('AutoDownloadMedia')}

@@ -288,6 +268,6 @@ export default memo(withGlobal( }; }, (setGlobal, actions): DispatchProps => pick(actions, [ - 'setSettingOption', 'loadStickerSets', 'loadAddedStickers', 'loadContentSettings', 'updateContentSettings', + 'setSettingOption', 'loadStickerSets', 'loadAddedStickers', ]), )(SettingsGeneral)); diff --git a/src/components/left/settings/SettingsPrivacy.tsx b/src/components/left/settings/SettingsPrivacy.tsx index d8a2eeaea..df10608a3 100644 --- a/src/components/left/settings/SettingsPrivacy.tsx +++ b/src/components/left/settings/SettingsPrivacy.tsx @@ -8,6 +8,7 @@ import { pick } from '../../../util/iteratees'; import useLang from '../../../hooks/useLang'; import ListItem from '../../ui/ListItem'; +import Checkbox from '../../ui/Checkbox'; type OwnProps = { onScreenSelect: (screen: SettingsScreens) => void; @@ -17,6 +18,8 @@ type StateProps = { hasPassword?: boolean; blockedCount: number; sessionsCount: number; + isSensitiveEnabled?: boolean; + canChangeSensitive?: boolean; visibilityPrivacyPhoneNumber?: PrivacyVisibility; visibilityPrivacyLastSeen?: PrivacyVisibility; visibilityPrivacyProfilePhoto?: PrivacyVisibility; @@ -24,13 +27,17 @@ type StateProps = { visibilityPrivacyGroupChats?: PrivacyVisibility; }; -type DispatchProps = Pick; +type DispatchProps = Pick; const SettingsPrivacy: FC = ({ onScreenSelect, hasPassword, blockedCount, sessionsCount, + isSensitiveEnabled, + canChangeSensitive, visibilityPrivacyPhoneNumber, visibilityPrivacyLastSeen, visibilityPrivacyProfilePhoto, @@ -39,12 +46,15 @@ const SettingsPrivacy: FC = ({ loadPrivacySettings, loadBlockedContacts, loadAuthorizations, + loadContentSettings, + updateContentSettings, }) => { useEffect(() => { loadBlockedContacts(); loadAuthorizations(); loadPrivacySettings(); - }, [loadBlockedContacts, loadAuthorizations, loadPrivacySettings]); + loadContentSettings(); + }, [loadBlockedContacts, loadAuthorizations, loadPrivacySettings, loadContentSettings]); const lang = useLang(); @@ -169,6 +179,19 @@ const SettingsPrivacy: FC = ({
+ +
+

+ {lang('lng_settings_sensitive_title')} +

+ +
); }; @@ -177,7 +200,7 @@ export default memo(withGlobal( (global): StateProps => { const { settings: { - byKey: { hasPassword }, + byKey: { hasPassword, isSensitiveEnabled, canChangeSensitive }, privacy, }, blocked, @@ -188,6 +211,8 @@ export default memo(withGlobal( hasPassword, blockedCount: blocked.totalCount, sessionsCount: activeSessions.length, + isSensitiveEnabled, + canChangeSensitive, visibilityPrivacyPhoneNumber: privacy.phoneNumber && privacy.phoneNumber.visibility, visibilityPrivacyLastSeen: privacy.lastSeen && privacy.lastSeen.visibility, visibilityPrivacyProfilePhoto: privacy.profilePhoto && privacy.profilePhoto.visibility, @@ -196,6 +221,6 @@ export default memo(withGlobal( }; }, (setGlobal, actions): DispatchProps => pick(actions, [ - 'loadBlockedContacts', 'loadAuthorizations', 'loadPrivacySettings', + 'loadBlockedContacts', 'loadAuthorizations', 'loadPrivacySettings', 'loadContentSettings', 'updateContentSettings', ]), )(SettingsPrivacy));