Clean up flags
This commit is contained in:
@@ -48,14 +48,15 @@ export async function refresh({strategy}: {strategy: FeatureFetchStrategy}) {
|
||||
/**
|
||||
* Converts our metadata into GrowthBook attributes and sets them.
|
||||
*/
|
||||
export function setAttributes({base, session, preferences}: Metadata) {
|
||||
const {deviceId, sessionId, ...br} = base
|
||||
export function setAttributes({
|
||||
base,
|
||||
geolocation,
|
||||
session,
|
||||
preferences,
|
||||
}: Metadata) {
|
||||
features.setAttributes({
|
||||
device_id: deviceId, // GrowthBook special field
|
||||
session_id: sessionId, // GrowthBook special field
|
||||
user_id: session?.did, // GrowthBook special field
|
||||
id: session?.did, // GrowthBook special field
|
||||
...br,
|
||||
...base,
|
||||
...geolocation,
|
||||
...(session || {}),
|
||||
...(preferences || {}),
|
||||
})
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
export enum Features {
|
||||
DebugFeedContext = 'debug_show_feedcontext',
|
||||
IsBskyTeam = 'is_bsky_team_member',
|
||||
DisableOnboardingFindContacts = 'disable_onboarding_find_contacts',
|
||||
DisableSettingsFindContacts = 'disable_settings_find_contacts',
|
||||
DisableLiveNowBeta = 'disable_live_now_beta',
|
||||
// core flags
|
||||
IsBskyTeam = 'is_bsky_team',
|
||||
|
||||
// debug flags
|
||||
DebugFeedContext = 'debug_feed_context',
|
||||
|
||||
// feature flags
|
||||
ImportContactsOnboardingDisable = 'import_contacts:onboarding:disable',
|
||||
ImportContactsSettingsDisable = 'import_contacts:settings:disable',
|
||||
LiveNowBetaDisable = 'live_now_beta:disable',
|
||||
}
|
||||
|
||||
@@ -53,7 +53,6 @@ export type NavigationMetadata = {
|
||||
}
|
||||
let navigationMetadata: NavigationMetadata | undefined
|
||||
export function getNavigationMetadata() {
|
||||
console.log('metadata', JSON.stringify(navigationMetadata, null, 2))
|
||||
return navigationMetadata
|
||||
}
|
||||
export function setNavigationMetadata(meta: NavigationMetadata | undefined) {
|
||||
|
||||
@@ -24,7 +24,7 @@ export const enabled = createIsEnabledCheck(props => {
|
||||
'2026-01-16T00:00:00.000Z',
|
||||
props.currentProfile.createdAt,
|
||||
) &&
|
||||
!props.features.enabled(props.features.DisableLiveNowBeta)
|
||||
!props.features.enabled(props.features.LiveNowBetaDisable)
|
||||
)
|
||||
})
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ export function Onboarding() {
|
||||
ENV !== 'e2e' &&
|
||||
IS_NATIVE &&
|
||||
findContactsEnabled &&
|
||||
!ax.features.enabled(ax.features.DisableOnboardingFindContacts)
|
||||
!ax.features.enabled(ax.features.ImportContactsOnboardingDisable)
|
||||
|
||||
const [state, dispatch] = useReducer(
|
||||
reducer,
|
||||
|
||||
@@ -213,7 +213,7 @@ export function SettingsScreen({}: Props) {
|
||||
</SettingsList.LinkItem>
|
||||
{IS_NATIVE &&
|
||||
findContactsEnabled &&
|
||||
!ax.features.enabled(ax.features.DisableSettingsFindContacts) && (
|
||||
!ax.features.enabled(ax.features.ImportContactsSettingsDisable) && (
|
||||
<SettingsList.LinkItem
|
||||
to="/settings/find-contacts"
|
||||
label={_(msg`Find friends from contacts`)}>
|
||||
|
||||
@@ -106,7 +106,7 @@ export function useCanGoLive() {
|
||||
const ax = useAnalytics()
|
||||
const {hasSession} = useSession()
|
||||
if (!hasSession) return false
|
||||
return IS_DEV ? true : !ax.features.enabled(ax.features.DisableLiveNowBeta)
|
||||
return IS_DEV ? true : !ax.features.enabled(ax.features.LiveNowBetaDisable)
|
||||
}
|
||||
|
||||
export function useCheckEmailConfirmed() {
|
||||
|
||||
Reference in New Issue
Block a user