Add feature gate

This commit is contained in:
Alex Benzer
2025-11-29 19:08:37 -08:00
parent 62b051d244
commit d94289015d
+7 -5
View File
@@ -31,7 +31,7 @@ import {isStatusStillActive, validateStatus} from '#/lib/actor-status'
import {DISCOVER_FEED_URI, KNOWN_SHUTDOWN_FEEDS} from '#/lib/constants' import {DISCOVER_FEED_URI, KNOWN_SHUTDOWN_FEEDS} from '#/lib/constants'
import {useInitialNumToRender} from '#/lib/hooks/useInitialNumToRender' import {useInitialNumToRender} from '#/lib/hooks/useInitialNumToRender'
import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback' import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback'
import {logEvent} from '#/lib/statsig/statsig' import {logEvent, useGate} from '#/lib/statsig/statsig'
import {isNetworkError} from '#/lib/strings/errors' import {isNetworkError} from '#/lib/strings/errors'
import {logger} from '#/logger' import {logger} from '#/logger'
import {isIOS, isNative, isWeb} from '#/platform/detection' import {isIOS, isNative, isWeb} from '#/platform/detection'
@@ -229,6 +229,7 @@ let PostFeed = ({
const {_} = useLingui() const {_} = useLingui()
const queryClient = useQueryClient() const queryClient = useQueryClient()
const {currentAccount, hasSession} = useSession() const {currentAccount, hasSession} = useSession()
const gate = useGate()
const initialNumToRender = useInitialNumToRender() const initialNumToRender = useInitialNumToRender()
const feedFeedback = useFeedFeedbackContext() const feedFeedback = useFeedFeedbackContext()
const [isPTRing, setIsPTRing] = useState(false) const [isPTRing, setIsPTRing] = useState(false)
@@ -506,9 +507,9 @@ let PostFeed = ({
'interstitial2-' + sliceIndex + '-' + lastFetchedAt, 'interstitial2-' + sliceIndex + '-' + lastFetchedAt,
}) })
} }
// Add composer prompt for Discover and Following feeds (after trending bar if it exists) // Show composer prompt for Discover and Following feeds
// Feature gate disabled - always show
if ( if (
gate('show_composer_prompt') &&
hasSession && hasSession &&
(feedUriOrActorDid === DISCOVER_FEED_URI || (feedUriOrActorDid === DISCOVER_FEED_URI ||
feed === 'following') feed === 'following')
@@ -533,8 +534,8 @@ let PostFeed = ({
} }
} else if (feedKind === 'following') { } else if (feedKind === 'following') {
if (sliceIndex === 0) { if (sliceIndex === 0) {
// Add composer prompt for Following feed // Show composer prompt for Following feed
if (hasSession) { if (gate('show_composer_prompt') && hasSession) {
arr.push({ arr.push({
type: 'composerPrompt', type: 'composerPrompt',
key: 'composerPrompt-' + sliceIndex, key: 'composerPrompt-' + sliceIndex,
@@ -664,6 +665,7 @@ let PostFeed = ({
hasPressedShowLessUris, hasPressedShowLessUris,
ageAssuranceBannerState, ageAssuranceBannerState,
isCurrentFeedAtStartupSelected, isCurrentFeedAtStartupSelected,
gate,
]) ])
// events // events