From 03bc6706f6ceef994cd23776d7bc620d70c4bf89 Mon Sep 17 00:00:00 2001 From: William Grant Date: Mon, 3 Apr 2023 14:09:05 +0200 Subject: [PATCH] feat: added legacy mode timer notification copy --- _locales/en/messages.json | 2 ++ ts/components/conversation/TimerNotification.tsx | 13 ++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 93be78ff3..a01aad19c 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -182,7 +182,9 @@ "timerModeRead": "read", "timerModeSent": "sent", "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$", + "theyChangedTheTimerLegacy": "$name$ set the disappearing message timer to $time$", "timerOption_0_seconds": "Off", "timerOption_5_seconds": "5 seconds", "timerOption_10_seconds": "10 seconds", diff --git a/ts/components/conversation/TimerNotification.tsx b/ts/components/conversation/TimerNotification.tsx index 9ee4cabed..b629bc4f1 100644 --- a/ts/components/conversation/TimerNotification.tsx +++ b/ts/components/conversation/TimerNotification.tsx @@ -29,8 +29,11 @@ export const TimerNotification = (props: PropsForExpirationTimer) => { } = props; const contact = profileName || pubkey; + // TODO legacy messages support will be removed in a future release const mode = - expirationType === 'deleteAfterRead' + expirationType === 'legacy' + ? null + : expirationType === 'deleteAfterRead' ? window.i18n('timerModeRead') : window.i18n('timerModeSent'); @@ -39,13 +42,17 @@ export const TimerNotification = (props: PropsForExpirationTimer) => { case 'fromOther': textToRender = disabled ? window.i18n('disabledDisappearingMessages', [contact, timespan]) - : window.i18n('theyChangedTheTimer', [contact, timespan, mode]); + : mode + ? window.i18n('theyChangedTheTimer', [contact, timespan, mode]) + : window.i18n('theyChangedTheTimerLegacy', [contact, timespan]); break; case 'fromMe': case 'fromSync': textToRender = disabled ? window.i18n('youDisabledDisappearingMessages') - : window.i18n('youChangedTheTimer', [timespan, mode]); + : mode + ? window.i18n('youChangedTheTimer', [timespan, mode]) + : window.i18n('youChangedTheTimerLegacy', [timespan]); break; default: throw missingCaseError(type);