fix: do not show DaR/S followsetting button for legacy

pull/2940/head
Audric Ackermann 1 year ago
parent 286260fae8
commit 5f53a44f6c

@ -193,7 +193,7 @@
"followSettingDisabled": "Messages you send will no longer disappear. Are you sure you want to turn off disappearing messages?", "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$?", "followSettingTimeAndType": "Set your messages to disappear $time$ after they have been $type$?",
"youChangedTheTimer": "<b>You</b> have set messages to disappear <b>$time$</b> after they have been <b>$mode$</b>", "youChangedTheTimer": "<b>You</b> have set messages to disappear <b>$time$</b> after they have been <b>$mode$</b>",
"youChangedTheTimerLegacy": "<b>You<b> set the disappearing message timer to <b>$time$</b>", "youChangedTheTimerLegacy": "<b>You</b> set the disappearing message timer to <b>$time$</b>",
"theyChangedTheTimer": "<b>$name$</b> has set messages to disappear <b>$time$</b> after they have been <b>$mode$</b>", "theyChangedTheTimer": "<b>$name$</b> has set messages to disappear <b>$time$</b> after they have been <b>$mode$</b>",
"theyChangedTheTimerLegacy": "<b>$name$</b> set the disappearing message timer to <b>$time$</b>", "theyChangedTheTimerLegacy": "<b>$name$</b> set the disappearing message timer to <b>$time$</b>",
"timerOption_0_seconds": "Off", "timerOption_0_seconds": "Off",

@ -20,7 +20,6 @@ import { Flex } from '../basic/Flex';
import { TextWithChildren } from '../basic/Text'; import { TextWithChildren } from '../basic/Text';
import { ExpirableReadableMessage } from './message/message-item/ExpirableReadableMessage'; import { ExpirableReadableMessage } from './message/message-item/ExpirableReadableMessage';
// eslint-disable-next-line import/order // eslint-disable-next-line import/order
import { pick } from 'lodash';
import { ConversationInteraction } from '../../interactions'; import { ConversationInteraction } from '../../interactions';
import { getConversationController } from '../../session/conversations'; import { getConversationController } from '../../session/conversations';
import { updateConfirmModal } from '../../state/ducks/modalDialog'; import { updateConfirmModal } from '../../state/ducks/modalDialog';
@ -105,12 +104,8 @@ function useAreSameThanOurSide(
const FollowSettingsButton = (props: PropsForExpirationTimer) => { const FollowSettingsButton = (props: PropsForExpirationTimer) => {
const v2Released = ReleasedFeatures.isUserConfigFeatureReleasedCached(); const v2Released = ReleasedFeatures.isUserConfigFeatureReleasedCached();
const isPrivateAndFriend = useSelectedIsPrivateFriend(); const isPrivateAndFriend = useSelectedIsPrivateFriend();
const click = useFollowSettingsButtonClick( const click = useFollowSettingsButtonClick(props);
pick(props, ['disabled', 'expirationMode', 'timespanText', 'timespanSeconds']) const areSameThanOurs = useAreSameThanOurSide(props);
);
const areSameThanOurs = useAreSameThanOurSide(
pick(props, ['disabled', 'expirationMode', 'timespanSeconds'])
);
if (!v2Released || !isPrivateAndFriend) { if (!v2Released || !isPrivateAndFriend) {
return null; return null;
@ -119,7 +114,8 @@ const FollowSettingsButton = (props: PropsForExpirationTimer) => {
props.type === 'fromMe' || props.type === 'fromMe' ||
props.type === 'fromSync' || props.type === 'fromSync' ||
props.pubkey === UserUtils.getOurPubKeyStrFromCache() || props.pubkey === UserUtils.getOurPubKeyStrFromCache() ||
areSameThanOurs areSameThanOurs ||
props.expirationMode === 'legacy' // we cannot follow settings with legacy mode
) { ) {
return null; return null;
} }

Loading…
Cancel
Save