From f9c473768c464b810b72c7ca88232ce0b63d02a2 Mon Sep 17 00:00:00 2001 From: automated-signal <37887102+automated-signal@users.noreply.github.com> Date: Fri, 7 Oct 2022 15:12:10 -0700 Subject: [PATCH] Enable stories in beta builds Co-authored-by: Scott Nonnenberg --- ts/RemoteConfig.ts | 2 ++ ts/components/WhatsNewModal.tsx | 4 ++++ ts/types/Stories.ts | 7 ++++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ts/RemoteConfig.ts b/ts/RemoteConfig.ts index c10407034..64bf47d36 100644 --- a/ts/RemoteConfig.ts +++ b/ts/RemoteConfig.ts @@ -30,11 +30,13 @@ export type ConfigKeyType = | 'desktop.showUserBadges.beta' | 'desktop.showUserBadges2' | 'desktop.stories' + | 'desktop.stories.beta' | 'desktop.usernames' | 'global.attachments.maxBytes' | 'global.calling.maxGroupCallRingSize' | 'global.groupsv2.groupSizeHardLimit' | 'global.groupsv2.maxGroupSize'; + type ConfigValueType = { name: ConfigKeyType; enabled: boolean; diff --git a/ts/components/WhatsNewModal.tsx b/ts/components/WhatsNewModal.tsx index f316bab7c..0745f7411 100644 --- a/ts/components/WhatsNewModal.tsx +++ b/ts/components/WhatsNewModal.tsx @@ -34,6 +34,10 @@ const releaseNotes: ReleaseNotesType = { key: 'WhatsNew__v5.63--0', components: undefined, }, + { + key: 'WhatsNew__v5.63--beta.2', + components: undefined, + }, ], }; diff --git a/ts/types/Stories.ts b/ts/types/Stories.ts index fef9a7fdf..415562ce9 100644 --- a/ts/types/Stories.ts +++ b/ts/types/Stories.ts @@ -10,6 +10,7 @@ import type { SendStatus } from '../messages/MessageSendState'; import type { StoryDistributionListDataType } from '../state/ducks/storyDistributionLists'; import type { UUIDStringType } from './UUID'; import { isEnabled } from '../RemoteConfig'; +import { isBeta } from '../util/version'; export type ReplyType = { author: Pick< @@ -145,7 +146,11 @@ export enum HasStories { } const getStoriesAvailable = () => - isEnabled('desktop.stories') || isEnabled('desktop.internalUser'); + isEnabled('desktop.stories') || + isEnabled('desktop.internalUser') || + (isEnabled('desktop.stories.beta') && isBeta(window.getVersion())); + const getStoriesDisabled = () => window.Events.getHasStoriesDisabled(); + export const getStoriesBlocked = (): boolean => !getStoriesAvailable() || getStoriesDisabled();