feat: added legacy mode timer notification copy

pull/2660/head
William Grant 3 years ago
parent 349b513051
commit 03bc6706f6

@ -182,7 +182,9 @@
"timerModeRead": "read", "timerModeRead": "read",
"timerModeSent": "sent", "timerModeSent": "sent",
"youChangedTheTimer": "You have set messages to disappear $time$ after they have been $mode$", "youChangedTheTimer": "You have set messages to disappear $time$ after they have been $mode$",
"youChangedTheTimerLegacy": "You set the disappearing message timer to $time$",
"theyChangedTheTimer": "$name$ has set messages to disappear $time$ after they have been $mode$", "theyChangedTheTimer": "$name$ has set messages to disappear $time$ after they have been $mode$",
"theyChangedTheTimerLegacy": "$name$ set the disappearing message timer to $time$",
"timerOption_0_seconds": "Off", "timerOption_0_seconds": "Off",
"timerOption_5_seconds": "5 seconds", "timerOption_5_seconds": "5 seconds",
"timerOption_10_seconds": "10 seconds", "timerOption_10_seconds": "10 seconds",

@ -29,8 +29,11 @@ export const TimerNotification = (props: PropsForExpirationTimer) => {
} = props; } = props;
const contact = profileName || pubkey; const contact = profileName || pubkey;
// TODO legacy messages support will be removed in a future release
const mode = const mode =
expirationType === 'deleteAfterRead' expirationType === 'legacy'
? null
: expirationType === 'deleteAfterRead'
? window.i18n('timerModeRead') ? window.i18n('timerModeRead')
: window.i18n('timerModeSent'); : window.i18n('timerModeSent');
@ -39,13 +42,17 @@ export const TimerNotification = (props: PropsForExpirationTimer) => {
case 'fromOther': case 'fromOther':
textToRender = disabled textToRender = disabled
? window.i18n('disabledDisappearingMessages', [contact, timespan]) ? window.i18n('disabledDisappearingMessages', [contact, timespan])
: window.i18n('theyChangedTheTimer', [contact, timespan, mode]); : mode
? window.i18n('theyChangedTheTimer', [contact, timespan, mode])
: window.i18n('theyChangedTheTimerLegacy', [contact, timespan]);
break; break;
case 'fromMe': case 'fromMe':
case 'fromSync': case 'fromSync':
textToRender = disabled textToRender = disabled
? window.i18n('youDisabledDisappearingMessages') ? window.i18n('youDisabledDisappearingMessages')
: window.i18n('youChangedTheTimer', [timespan, mode]); : mode
? window.i18n('youChangedTheTimer', [timespan, mode])
: window.i18n('youChangedTheTimerLegacy', [timespan]);
break; break;
default: default:
throw missingCaseError(type); throw missingCaseError(type);

Loading…
Cancel
Save