Get trending section indices from GrowthBook (#11319)
This commit is contained in:
@@ -211,10 +211,6 @@ export type PostFeedRef = {
|
||||
// const REFRESH_AFTER = STALE.HOURS.ONE
|
||||
const CHECK_LATEST_AFTER = STALE.SECONDS.THIRTY
|
||||
|
||||
const TRENDING_TOPICS_INDEX = 5
|
||||
const TRENDING_VIDEO_INDEX = 30
|
||||
const SUGGESTED_FOR_YOU_INDEX = 15
|
||||
|
||||
let PostFeed = ({
|
||||
feed,
|
||||
description,
|
||||
@@ -280,6 +276,15 @@ let PostFeed = ({
|
||||
const {rightNavVisible} = useLayoutBreakpoints()
|
||||
const areVideoFeedsEnabled = IS_NATIVE
|
||||
|
||||
const trendingIndices = ax.features.getValue(
|
||||
ax.features.TrendingDiscoverValues,
|
||||
{
|
||||
topics: 5,
|
||||
accounts: 15,
|
||||
videos: 30,
|
||||
},
|
||||
)
|
||||
|
||||
const [hasPressedShowLessUris, setHasPressedShowLessUris] = useState(
|
||||
() => new Set<string>(),
|
||||
)
|
||||
@@ -574,19 +579,19 @@ let PostFeed = ({
|
||||
key: 'composerPrompt-' + sliceIndex,
|
||||
})
|
||||
}
|
||||
} else if (sliceIndex === TRENDING_TOPICS_INDEX) {
|
||||
} else if (sliceIndex === trendingIndices.topics) {
|
||||
arr.push({
|
||||
type: 'interstitialFeedTrendingTopics',
|
||||
key: 'interstitialFeedTrendingTopics-' + sliceIndex,
|
||||
})
|
||||
} else if (sliceIndex === TRENDING_VIDEO_INDEX) {
|
||||
} else if (sliceIndex === trendingIndices.videos) {
|
||||
if (areVideoFeedsEnabled && !trendingVideoDisabled) {
|
||||
arr.push({
|
||||
type: 'interstitialTrendingVideos',
|
||||
key: 'interstitial-' + sliceIndex + '-' + lastFetchedAt,
|
||||
})
|
||||
}
|
||||
} else if (sliceIndex === SUGGESTED_FOR_YOU_INDEX) {
|
||||
} else if (sliceIndex === trendingIndices.accounts) {
|
||||
arr.push({
|
||||
type: 'interstitialFollows',
|
||||
key: 'interstitial-' + sliceIndex + '-' + lastFetchedAt,
|
||||
@@ -739,6 +744,7 @@ let PostFeed = ({
|
||||
ageAssuranceBannerState,
|
||||
isCurrentFeedAtStartupSelected,
|
||||
blockedOrMutedAuthors,
|
||||
trendingIndices,
|
||||
])
|
||||
|
||||
// events
|
||||
|
||||
Reference in New Issue
Block a user