Add 2 minute deletion duration for testing

This commit is contained in:
Chewbacca 2022-11-09 08:37:50 -05:00
parent f6290be1e2
commit f5ddd586f6
2 changed files with 12 additions and 5 deletions

View file

@ -33,6 +33,7 @@ const messages = defineMessages({
leaveChat: { id: 'chat_settings.options.leave_chat', defaultMessage: 'Leave Chat' }, leaveChat: { id: 'chat_settings.options.leave_chat', defaultMessage: 'Leave Chat' },
autoDeleteLabel: { id: 'chat_settings.auto_delete.label', defaultMessage: 'Auto-delete messages' }, autoDeleteLabel: { id: 'chat_settings.auto_delete.label', defaultMessage: 'Auto-delete messages' },
autoDeleteHint: { id: 'chat_settings.auto_delete.hint', defaultMessage: 'Sent messages will auto-delete after the time period selected' }, autoDeleteHint: { id: 'chat_settings.auto_delete.hint', defaultMessage: 'Sent messages will auto-delete after the time period selected' },
autoDelete2Minutes: { id: 'chat_settings.auto_delete.2minutes', defaultMessage: '2 minutes' },
autoDelete7Days: { id: 'chat_settings.auto_delete.7days', defaultMessage: '7 days' }, autoDelete7Days: { id: 'chat_settings.auto_delete.7days', defaultMessage: '7 days' },
autoDelete14Days: { id: 'chat_settings.auto_delete.14days', defaultMessage: '14 days' }, autoDelete14Days: { id: 'chat_settings.auto_delete.14days', defaultMessage: '14 days' },
autoDelete30Days: { id: 'chat_settings.auto_delete.30days', defaultMessage: '30 days' }, autoDelete30Days: { id: 'chat_settings.auto_delete.30days', defaultMessage: '30 days' },
@ -182,6 +183,11 @@ const ChatPageMain = () => {
label={intl.formatMessage(messages.autoDeleteLabel)} label={intl.formatMessage(messages.autoDeleteLabel)}
hint={intl.formatMessage(messages.autoDeleteHint)} hint={intl.formatMessage(messages.autoDeleteHint)}
/> />
<ListItem
label={intl.formatMessage(messages.autoDelete2Minutes)}
onSelect={() => handleUpdateChat(MessageExpirationValues.TWO_MINUTES)}
isSelected={chat.message_expiration === MessageExpirationValues.TWO_MINUTES}
/>
<ListItem <ListItem
label={intl.formatMessage(messages.autoDelete7Days)} label={intl.formatMessage(messages.autoDelete7Days)}
onSelect={() => handleUpdateChat(MessageExpirationValues.SEVEN)} onSelect={() => handleUpdateChat(MessageExpirationValues.SEVEN)}

View file

@ -16,13 +16,14 @@ import { queryClient } from './client';
import type { IAccount } from './accounts'; import type { IAccount } from './accounts';
export const messageExpirationOptions = [604800, 1209600, 2592000, 7776000]; export const messageExpirationOptions = [120, 604800, 1209600, 2592000, 7776000];
export enum MessageExpirationValues { export enum MessageExpirationValues {
'SEVEN' = messageExpirationOptions[0], 'TWO_MINUTES' = messageExpirationOptions[0],
'FOURTEEN' = messageExpirationOptions[1], 'SEVEN' = messageExpirationOptions[1],
'THIRTY' = messageExpirationOptions[2], 'FOURTEEN' = messageExpirationOptions[2],
'NINETY' = messageExpirationOptions[3] 'THIRTY' = messageExpirationOptions[3],
'NINETY' = messageExpirationOptions[4]
} }
export interface IChat { export interface IChat {