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 [isModalOpen, openModal, closeModal] = useFlag();
|
||||||
|
|
||||||
const autoTerminateValue = useMemo(() => {
|
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) {
|
if (ttlDays === undefined) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
@ -59,11 +61,11 @@ const SettingsActiveSessions: FC<OwnProps & StateProps> = ({
|
|||||||
if (ttlDays <= 30) {
|
if (ttlDays <= 30) {
|
||||||
return '30';
|
return '30';
|
||||||
}
|
}
|
||||||
if (ttlDays <= 90) {
|
if (ttlDays <= 93) {
|
||||||
return '90';
|
return '90';
|
||||||
}
|
}
|
||||||
if (ttlDays <= 180) {
|
if (ttlDays <= 183) {
|
||||||
return '180';
|
return '183';
|
||||||
}
|
}
|
||||||
|
|
||||||
return undefined;
|
return undefined;
|
||||||
@ -80,7 +82,7 @@ const SettingsActiveSessions: FC<OwnProps & StateProps> = ({
|
|||||||
value: '90',
|
value: '90',
|
||||||
}, {
|
}, {
|
||||||
label: lang('Months', 6, 'i'),
|
label: lang('Months', 6, 'i'),
|
||||||
value: '180',
|
value: '183',
|
||||||
}], [lang]);
|
}], [lang]);
|
||||||
|
|
||||||
const handleTerminateSessionClick = useCallback((hash: string) => {
|
const handleTerminateSessionClick = useCallback((hash: string) => {
|
||||||
|
|||||||
@ -39,7 +39,6 @@ const SettingsMain: FC<OwnProps & StateProps> = ({
|
|||||||
const {
|
const {
|
||||||
loadProfilePhotos,
|
loadProfilePhotos,
|
||||||
loadAuthorizations,
|
loadAuthorizations,
|
||||||
loadWebAuthorizations,
|
|
||||||
openPremiumModal,
|
openPremiumModal,
|
||||||
} = getActions();
|
} = getActions();
|
||||||
|
|
||||||
@ -60,9 +59,8 @@ const SettingsMain: FC<OwnProps & StateProps> = ({
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (lastSyncTime) {
|
if (lastSyncTime) {
|
||||||
loadAuthorizations();
|
loadAuthorizations();
|
||||||
loadWebAuthorizations();
|
|
||||||
}
|
}
|
||||||
}, [lastSyncTime, loadAuthorizations, loadWebAuthorizations]);
|
}, [lastSyncTime, loadAuthorizations]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="settings-content custom-scroll">
|
<div className="settings-content custom-scroll">
|
||||||
|
|||||||
@ -61,6 +61,7 @@ const SettingsPrivacy: FC<OwnProps & StateProps> = ({
|
|||||||
updateContentSettings,
|
updateContentSettings,
|
||||||
loadGlobalPrivacySettings,
|
loadGlobalPrivacySettings,
|
||||||
updateGlobalPrivacySettings,
|
updateGlobalPrivacySettings,
|
||||||
|
loadWebAuthorizations,
|
||||||
} = getActions();
|
} = getActions();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -68,7 +69,8 @@ const SettingsPrivacy: FC<OwnProps & StateProps> = ({
|
|||||||
loadAuthorizations();
|
loadAuthorizations();
|
||||||
loadPrivacySettings();
|
loadPrivacySettings();
|
||||||
loadContentSettings();
|
loadContentSettings();
|
||||||
}, [loadBlockedContacts, loadAuthorizations, loadPrivacySettings, loadContentSettings]);
|
loadWebAuthorizations();
|
||||||
|
}, [loadBlockedContacts, loadAuthorizations, loadPrivacySettings, loadContentSettings, loadWebAuthorizations]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isActive) {
|
if (isActive) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user