Clean up flags

This commit is contained in:
Eric Bailey
2026-01-22 15:34:48 -06:00
parent 25a1ed1209
commit 8e3922254c
7 changed files with 22 additions and 17 deletions
+8 -7
View File
@@ -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 || {}),
})
+10 -5
View File
@@ -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',
}
-1
View File
@@ -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)
)
})
+1 -1
View File
@@ -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,
+1 -1
View File
@@ -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`)}>
+1 -1
View File
@@ -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() {