Settings / Sessions: Fix session termination options (#1956)
This commit is contained in:
parent
c772a7b2eb
commit
753b29d99c
@ -50,6 +50,8 @@ const SettingsActiveSessions: FC<OwnProps & StateProps> = ({
|
||||
const [isModalOpen, openModal, closeModal] = useFlag();
|
||||
|
||||
const autoTerminateValue = useMemo(() => {
|
||||
// eslint-disable-next-line max-len
|
||||
// https://github.com/DrKLO/Telegram/blob/96dce2c9aabc33b87db61d830aa087b6b03fe397/TMessagesProj/src/main/java/org/telegram/ui/SessionsActivity.java#L195
|
||||
if (ttlDays === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
@ -59,11 +61,11 @@ const SettingsActiveSessions: FC<OwnProps & StateProps> = ({
|
||||
if (ttlDays <= 30) {
|
||||
return '30';
|
||||
}
|
||||
if (ttlDays <= 90) {
|
||||
if (ttlDays <= 93) {
|
||||
return '90';
|
||||
}
|
||||
if (ttlDays <= 180) {
|
||||
return '180';
|
||||
if (ttlDays <= 183) {
|
||||
return '183';
|
||||
}
|
||||
|
||||
return undefined;
|
||||
@ -80,7 +82,7 @@ const SettingsActiveSessions: FC<OwnProps & StateProps> = ({
|
||||
value: '90',
|
||||
}, {
|
||||
label: lang('Months', 6, 'i'),
|
||||
value: '180',
|
||||
value: '183',
|
||||
}], [lang]);
|
||||
|
||||
const handleTerminateSessionClick = useCallback((hash: string) => {
|
||||
|
||||
@ -39,7 +39,6 @@ const SettingsMain: FC<OwnProps & StateProps> = ({
|
||||
const {
|
||||
loadProfilePhotos,
|
||||
loadAuthorizations,
|
||||
loadWebAuthorizations,
|
||||
openPremiumModal,
|
||||
} = getActions();
|
||||
|
||||
@ -60,9 +59,8 @@ const SettingsMain: FC<OwnProps & StateProps> = ({
|
||||
useEffect(() => {
|
||||
if (lastSyncTime) {
|
||||
loadAuthorizations();
|
||||
loadWebAuthorizations();
|
||||
}
|
||||
}, [lastSyncTime, loadAuthorizations, loadWebAuthorizations]);
|
||||
}, [lastSyncTime, loadAuthorizations]);
|
||||
|
||||
return (
|
||||
<div className="settings-content custom-scroll">
|
||||
|
||||
@ -61,6 +61,7 @@ const SettingsPrivacy: FC<OwnProps & StateProps> = ({
|
||||
updateContentSettings,
|
||||
loadGlobalPrivacySettings,
|
||||
updateGlobalPrivacySettings,
|
||||
loadWebAuthorizations,
|
||||
} = getActions();
|
||||
|
||||
useEffect(() => {
|
||||
@ -68,7 +69,8 @@ const SettingsPrivacy: FC<OwnProps & StateProps> = ({
|
||||
loadAuthorizations();
|
||||
loadPrivacySettings();
|
||||
loadContentSettings();
|
||||
}, [loadBlockedContacts, loadAuthorizations, loadPrivacySettings, loadContentSettings]);
|
||||
loadWebAuthorizations();
|
||||
}, [loadBlockedContacts, loadAuthorizations, loadPrivacySettings, loadContentSettings, loadWebAuthorizations]);
|
||||
|
||||
useEffect(() => {
|
||||
if (isActive) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user