From 5f53a44f6c00dd7b5780ab665426093544b206ee Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Tue, 2 Jan 2024 15:16:02 +1100 Subject: [PATCH] fix: do not show DaR/S followsetting button for legacy --- _locales/en/messages.json | 2 +- ts/components/conversation/TimerNotification.tsx | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 26ef1abdb..b9fa7e92d 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -193,7 +193,7 @@ "followSettingDisabled": "Messages you send will no longer disappear. Are you sure you want to turn off disappearing messages?", "followSettingTimeAndType": "Set your messages to disappear $time$ after they have been $type$?", "youChangedTheTimer": "You have set messages to disappear $time$ after they have been $mode$", - "youChangedTheTimerLegacy": "You set the disappearing message timer to $time$", + "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", diff --git a/ts/components/conversation/TimerNotification.tsx b/ts/components/conversation/TimerNotification.tsx index d1abbdd42..185b9e76c 100644 --- a/ts/components/conversation/TimerNotification.tsx +++ b/ts/components/conversation/TimerNotification.tsx @@ -20,7 +20,6 @@ import { Flex } from '../basic/Flex'; import { TextWithChildren } from '../basic/Text'; import { ExpirableReadableMessage } from './message/message-item/ExpirableReadableMessage'; // eslint-disable-next-line import/order -import { pick } from 'lodash'; import { ConversationInteraction } from '../../interactions'; import { getConversationController } from '../../session/conversations'; import { updateConfirmModal } from '../../state/ducks/modalDialog'; @@ -105,12 +104,8 @@ function useAreSameThanOurSide( const FollowSettingsButton = (props: PropsForExpirationTimer) => { const v2Released = ReleasedFeatures.isUserConfigFeatureReleasedCached(); const isPrivateAndFriend = useSelectedIsPrivateFriend(); - const click = useFollowSettingsButtonClick( - pick(props, ['disabled', 'expirationMode', 'timespanText', 'timespanSeconds']) - ); - const areSameThanOurs = useAreSameThanOurSide( - pick(props, ['disabled', 'expirationMode', 'timespanSeconds']) - ); + const click = useFollowSettingsButtonClick(props); + const areSameThanOurs = useAreSameThanOurSide(props); if (!v2Released || !isPrivateAndFriend) { return null; @@ -119,7 +114,8 @@ const FollowSettingsButton = (props: PropsForExpirationTimer) => { props.type === 'fromMe' || props.type === 'fromSync' || props.pubkey === UserUtils.getOurPubKeyStrFromCache() || - areSameThanOurs + areSameThanOurs || + props.expirationMode === 'legacy' // we cannot follow settings with legacy mode ) { return null; }