diff --git a/ts/session/constants.ts b/ts/session/constants.ts index 7778058eb..3d0c05094 100644 --- a/ts/session/constants.ts +++ b/ts/session/constants.ts @@ -63,13 +63,6 @@ export const VALIDATION = { CLOSED_GROUP_SIZE_LIMIT: 100, }; -export const UI = { - COLORS: { - // COMMON - GREEN: '#00F782', - }, -}; - export const DEFAULT_RECENT_REACTS = ['😂', '🥰', '😢', '😡', '😮', '😈']; export const REACT_LIMIT = 6; diff --git a/ts/session/disappearing_messages/timerOptions.ts b/ts/session/disappearing_messages/timerOptions.ts index e880379e9..ef1ea5281 100644 --- a/ts/session/disappearing_messages/timerOptions.ts +++ b/ts/session/disappearing_messages/timerOptions.ts @@ -1,3 +1,4 @@ +import { isEmpty } from 'lodash'; import moment from 'moment'; import { LocalizerKeys } from '../../types/LocalizerKeys'; @@ -65,11 +66,20 @@ const VALUES: Array = timerOptionsDurations.map(t => { return t.seconds; }); +const filterOutDebugValues = (option: number) => { + // process.env.NODE_APP_INSTANCE is empty when the app is packaged, and not empty when starting from start-prod or start-dev + const isPackaged = isEmpty(process.env.NODE_APP_INSTANCE); + if (isPackaged) { + return option > 60; // when packaged, filter out options with less than 60s + } + return true; +}; + const DELETE_AFTER_READ = VALUES.filter(option => { return ( - option === 10 || // 10 seconds // TODO DO NOT MERGE Remove after QA - option === 30 || // 30 seconds // TODO DO NOT MERGE Remove after QA - option === 60 || // 1 minute // TODO DO NOT MERGE Remove after QA + option === 10 || // 10 seconds: filtered out when app is packaged with filterOutDebugValues + option === 30 || // 30 seconds: filtered out when app is packaged with filterOutDebugValues + option === 60 || // 1 minute : filtered out when app is packaged with filterOutDebugValues option === 300 || // 5 minutes option === 3600 || // 1 hour option === 43200 || // 12 hours @@ -77,32 +87,32 @@ const DELETE_AFTER_READ = VALUES.filter(option => { option === 604800 || // 1 week option === 1209600 // 2 weeks ); -}); +}).filter(filterOutDebugValues); const DELETE_AFTER_SEND = VALUES.filter(option => { return ( - option === 10 || // 10 seconds // TODO DO NOT MERGE Remove after QA - option === 30 || // 30 seconds // TODO DO NOT MERGE Remove after QA - option === 60 || // 1 minute // TODO DO NOT MERGE Remove after QA + option === 10 || // 10 seconds: filtered out when app is packaged with filterOutDebugValues + option === 30 || // 30 seconds: filtered out when app is packaged with filterOutDebugValues + option === 60 || // 1 minute : filtered out when app is packaged with filterOutDebugValues option === 43200 || // 12 hours option === 86400 || // 1 day option === 604800 || // 1 week option === 1209600 // 2 weeks ); -}); +}).filter(filterOutDebugValues); // TODO legacy messages support will be removed in a future release const DELETE_LEGACY = VALUES.filter(option => { return ( - option === 10 || // 10 seconds // TODO DO NOT MERGE Remove after QA - option === 30 || // 30 seconds // TODO DO NOT MERGE Remove after QA - option === 60 || // 1 minute // TODO DO NOT MERGE Remove after QA + option === 10 || // 10 seconds: filtered out when app is packaged with filterOutDebugValues + option === 30 || // 30 seconds: filtered out when app is packaged with filterOutDebugValues + option === 60 || // 1 minute : filtered out when app is packaged with filterOutDebugValues option === 43200 || // 12 hours option === 86400 || // 1 day option === 604800 || // 1 week option === 1209600 // 2 weeks ); -}); +}).filter(filterOutDebugValues); const DEFAULT_OPTIONS = { DELETE_AFTER_READ: 43200, // 12 hours