feat: anyone in a group can change the setting

before the v2 release
pull/2971/head
William Grant 2 years ago
parent 251f2e1d37
commit fd73787192

@ -103,6 +103,8 @@ export const OverlayDisappearingMessages = () => {
const [timeSelected, setTimeSelected] = useState(expireTimer || 0);
const timerOptions = useTimerOptionsByMode(modeSelected, hasOnlyOneMode);
const isV2Released = ReleasedFeatures.isDisappearMessageV2FeatureReleasedCached();
const handleSetMode = async () => {
if (hasOnlyOneMode) {
if (selectedConversationKey && singleMode) {
@ -128,14 +130,14 @@ export const OverlayDisappearingMessages = () => {
};
useEffect(() => {
if (!ReleasedFeatures.isDisappearMessageV2FeatureReleasedCached()) {
if (!isV2Released) {
setModeSelected(
expirationMode === 'deleteAfterRead' || expirationMode === 'deleteAfterSend'
? 'legacy'
: expirationMode
);
}
}, [expirationMode]);
}, [expirationMode, isV2Released]);
useEffect(() => {
// NOTE loads a time value from the conversation model or the default
@ -199,7 +201,7 @@ export const OverlayDisappearingMessages = () => {
/>
</>
)}
{isGroup && !weAreAdmin && (
{isGroup && isV2Released && !weAreAdmin && (
<>
<SpacerLG />
<StyledNonAdminDescription>

@ -182,9 +182,7 @@ const getSelectedConversationExpirationModesWithLegacy = (convo: ReduxConversati
// The new modes are disabled by default
if (modes && modes.length > 1) {
modes.forEach((mode: any) => {
modesWithDisabledState[mode] = Boolean(
(mode !== 'legacy' && mode !== 'off') || (isClosedGroup && !convo.weAreAdmin)
);
modesWithDisabledState[mode] = Boolean(mode !== 'legacy' && mode !== 'off');
});
}
@ -213,6 +211,7 @@ export const getSelectedConversationExpirationModes = (state: StateType) => {
modes = [modes[0], modes[2]];
}
// NOTE disabled = true
const modesWithDisabledState: Record<string, boolean> = {};
if (modes && modes.length > 1) {
modes.forEach((mode: any) => {

Loading…
Cancel
Save