fix: hide banner until we can create new groups

pull/3281/head
Audric Ackermann 3 months ago
parent 010801b78c
commit ccd41f6bdc
No known key found for this signature in database

@ -69,6 +69,7 @@ import {
useSelectedWeAreAdmin, useSelectedWeAreAdmin,
} from '../../state/selectors/selectedConversation'; } from '../../state/selectors/selectedConversation';
import { useSelectedDisableLegacyGroupDeprecatedActions } from '../../hooks/useRefreshReleasedFeaturesTimestamp'; import { useSelectedDisableLegacyGroupDeprecatedActions } from '../../hooks/useRefreshReleasedFeaturesTimestamp';
import { useAreGroupsCreatedAsNewGroupsYet } from '../../state/selectors/releasedFeatures';
const DEFAULT_JPEG_QUALITY = 0.85; const DEFAULT_JPEG_QUALITY = 0.85;
@ -675,6 +676,8 @@ function OutdatedLegacyGroupBanner() {
const isLegacyGroup = const isLegacyGroup =
!isPrivate && !isPublic && selectedConversationKey && selectedConversationKey.startsWith('05'); !isPrivate && !isPublic && selectedConversationKey && selectedConversationKey.startsWith('05');
const newGroupsCanBeCreated = useAreGroupsCreatedAsNewGroupsYet();
// FIXME change the date here. Remove after QA // FIXME change the date here. Remove after QA
const text = deprecatedLegacyGroups const text = deprecatedLegacyGroups
? localize( ? localize(
@ -686,7 +689,7 @@ function OutdatedLegacyGroupBanner() {
.withArgs({ date: '[Date]' }) .withArgs({ date: '[Date]' })
.toString(); .toString();
return isLegacyGroup ? ( return isLegacyGroup && newGroupsCanBeCreated ? (
<NoticeBanner <NoticeBanner
text={text} text={text}
onBannerClick={() => { onBannerClick={() => {

@ -25,6 +25,7 @@ import { groupInfoActions } from '../../../state/ducks/metaGroups';
import { updateConfirmModal } from '../../../state/ducks/modalDialog'; import { updateConfirmModal } from '../../../state/ducks/modalDialog';
import { setLeftOverlayMode } from '../../../state/ducks/section'; import { setLeftOverlayMode } from '../../../state/ducks/section';
import { SessionButtonColor, SessionButton } from '../../basic/SessionButton'; import { SessionButtonColor, SessionButton } from '../../basic/SessionButton';
import { useAreGroupsCreatedAsNewGroupsYet } from '../../../state/selectors/releasedFeatures';
export const ConversationHeaderWithDetails = () => { export const ConversationHeaderWithDetails = () => {
const isSelectionMode = useIsMessageSelectionMode(); const isSelectionMode = useIsMessageSelectionMode();
@ -121,8 +122,9 @@ function RecreateGroupButton() {
const weAreAdmin = useSelectedWeAreAdmin(); const weAreAdmin = useSelectedWeAreAdmin();
const showRecreateGroupModal = useShowRecreateModal(); const showRecreateGroupModal = useShowRecreateModal();
const newGroupsCanBeCreated = useAreGroupsCreatedAsNewGroupsYet();
if (!isLegacyGroup || !weAreAdmin) { if (!isLegacyGroup || !weAreAdmin || !newGroupsCanBeCreated) {
return null; return null;
} }

@ -4,11 +4,16 @@ import { DURATION } from '../../session/constants';
// update this to be when we ship desktop groups REMOVE AFTER QA // update this to be when we ship desktop groups REMOVE AFTER QA
const GROUP_DESKTOP_RELEASE = 1767225600 * 1000; // currently Thursday, January 1, 2026 12:00:00 AM const GROUP_DESKTOP_RELEASE = 1767225600 * 1000; // currently Thursday, January 1, 2026 12:00:00 AM
// FIXME update this to the correct timestamp REMOVE AFTER QA /**
* 1 week after the release of groups (more or less), we force new groups to be created as new groups
*/
export const START_CREATE_NEW_GROUP_TIMESTAMP_MS = GROUP_DESKTOP_RELEASE + DURATION.WEEKS * 1; export const START_CREATE_NEW_GROUP_TIMESTAMP_MS = GROUP_DESKTOP_RELEASE + DURATION.WEEKS * 1;
// FIXME update this to the correct timestamp REMOVE AFTER QA /**
export const LEGACY_GROUP_DEPRECATED_TIMESTAMP_MS = GROUP_DESKTOP_RELEASE + DURATION.WEEKS * 3; * 2 weeks after `START_CREATE_NEW_GROUP_TIMESTAMP_MS`, we mark legacy groups readonly
*/
export const LEGACY_GROUP_DEPRECATED_TIMESTAMP_MS =
START_CREATE_NEW_GROUP_TIMESTAMP_MS + DURATION.WEEKS * 2;
export interface ReleasedFeaturesState { export interface ReleasedFeaturesState {
legacyGroupDeprecationTimestampRefreshAtMs: number; legacyGroupDeprecationTimestampRefreshAtMs: number;

Loading…
Cancel
Save