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