fix: single mode should show the correct timer values

if a mode is invalid we return no timer options
pull/2971/head
William Grant 2 years ago
parent c24487b938
commit 3d2c1fbe78

@ -89,7 +89,7 @@ export const OverlayDisappearingMessages = () => {
const weAreAdmin = useSelectedWeAreAdmin(); const weAreAdmin = useSelectedWeAreAdmin();
const [modeSelected, setModeSelected] = useState<DisappearingMessageConversationType | undefined>( const [modeSelected, setModeSelected] = useState<DisappearingMessageConversationType | undefined>(
expirationType hasOnlyOneMode ? singleMode : expirationType
); );
const [timeSelected, setTimeSelected] = useState(expireTimer || 0); const [timeSelected, setTimeSelected] = useState(expireTimer || 0);

@ -331,7 +331,7 @@ export function useTimerOptionsByMode(disappearingMessageMode?: string, hasOnlyO
); );
}); });
default: default:
return options; return [];
} }
}); });
} }

Loading…
Cancel
Save