remove ttl unused settings and all translated key

This commit is contained in:
Audric Ackermann 2020-09-01 11:14:59 +10:00
parent 63ac6fb003
commit 0e75510e5b
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4
5 changed files with 1 additions and 83 deletions

View File

@ -1160,14 +1160,6 @@
"androidKey": "preferences__typing_indicators",
"ignoreCase": true
},
"messageTTL": {
"message": "Message TTL",
"description": "Title of the Message TTL setting"
},
"messageTTLSettingDescription": {
"message": "Time to live (how long the recipient will have to collect their messages)",
"description": "Description of the time to live setting"
},
"zoomFactorSettingTitle": {
"message": "Zoom Factor",
"description": "Title of the Zoom Factor setting"

View File

@ -1517,14 +1517,6 @@
"message": "See and share when messages are being typed (applies to all sessions).",
"description": "Description of the typing indicators setting"
},
"messageTTL": {
"message": "Message TTL",
"description": "Title of the Message TTL setting"
},
"messageTTLSettingDescription": {
"message": "Time to live (how long the recipient will have to collect their messages)",
"description": "Description of the time to live setting"
},
"zoomFactorSettingTitle": {
"message": "Zoom Factor",
"description": "Title of the Zoom Factor setting"

View File

@ -1517,14 +1517,6 @@
"message": "Получать и отсылать уведомления когда вы и ваш собедник набирает сообщение (для всех контактов).",
"description": "Description of the typing indicators setting"
},
"messageTTL": {
"message": "Message TTL",
"description": "Title of the Message TTL setting"
},
"messageTTLSettingDescription": {
"message": "Time to live (how long the recipient will have to collect their messages)",
"description": "Description of the time to live setting"
},
"zoomFactorSettingTitle": {
"message": "Масштабирование Приложения",
"description": "Title of the Zoom Factor setting"

View File

@ -10,7 +10,7 @@ import {
import { BlockedNumberController, UserUtil } from '../../../util';
import { MultiDeviceProtocol } from '../../../session/protocols';
import { PubKey } from '../../../session/types';
import { NumberUtils, ToastUtils } from '../../../session/utils';
import { ToastUtils } from '../../../session/utils';
export enum SessionSettingCategory {
Appearance = 'appearance',
@ -444,35 +444,6 @@ export class SettingsView extends React.Component<SettingsViewProps, State> {
onClick: undefined,
confirmationDialogParams: undefined,
},
{
id: 'message-ttl',
title: window.i18n('messageTTL'),
description: window.i18n('messageTTLSettingDescription'),
// TODO: Revert
// TTL set to 2 days for mobile push notification compabability
// temporary fix .t 13/07/2020
//
// TODO: Hook up this TTL to message sending when re-enabling.
// This setting is not used in any libsession sending code
hidden: true,
type: SessionSettingType.Slider,
category: SessionSettingCategory.Privacy,
setFn: undefined,
comparisonValue: undefined,
onClick: undefined,
content: {
dotsEnabled: true,
step: 6,
min: 12,
max: 96,
defaultValue: NumberUtils.msAsUnit(
window.CONSTANTS.TTL_DEFAULT_REGULAR_MESSAGE,
'hour'
),
info: (value: number) => `${value} Hours`,
},
confirmationDialogParams: undefined,
},
{
id: 'zoom-factor-setting',
title: window.i18n('zoomFactorSettingTitle'),

View File

@ -1,33 +1,4 @@
type TimeUnit =
| 'second'
| 'seconds'
| 'minute'
| 'minutes'
| 'hour'
| 'hours'
| 'day'
| 'days';
export const MINUTES = 60 * 1000; // in ms
// tslint:disable: binary-expression-operand-order
export const HOURS = 60 * MINUTES; // in ms
export const DAYS = 24 * HOURS; // in ms
export const msAsUnit = (value: number, unit: TimeUnit) => {
// Converts milliseconds to your preferred unit
// Valid units: second(s), minute(s), hour(s), day(s)
const unitAsSingular = unit.replace(new RegExp('s?$'), '');
switch (unitAsSingular) {
case 'second':
return value / 1000;
case 'minute':
return value / 60 / 1000;
case 'hour':
return value / 60 / 60 / 1000;
case 'day':
return value / 24 / 60 / 60 / 1000;
default:
return value;
}
};