Fix undefined logic, remove header for interstitial

This commit is contained in:
Dan Abramov
2025-01-19 20:49:43 +00:00
parent b1079471a6
commit 69c035214d
6 changed files with 12 additions and 10 deletions
@@ -174,7 +174,7 @@ function VideoCards({
sourceContext={{
type: 'feedgen',
uri: VIDEO_FEED_URI,
feedCacheKey: 'discover',
sourceInterstitial: 'discover',
}}
onInteract={() => {
logEvent('videoCard:click', {
@@ -214,7 +214,7 @@ function VideoCards({
sourceContext={{
type: 'feedgen',
uri: VIDEO_FEED_URI,
feedCacheKey: 'explore',
sourceInterstitial: 'explore',
}}
onInteract={() => {
logEvent('videoCard:click', {
@@ -107,6 +107,11 @@ export function FeedHeader({
return null
}
if (sourceContext.sourceInterstitial !== undefined) {
// For now, don't show the header if coming from an interstitial.
return null
}
return (
<View style={[a.flex_1, a.flex_row, a.align_center, a.gap_sm]}>
{info.avatar && <UserAvatar size={36} type="algo" avatar={info.avatar} />}
+2 -2
View File
@@ -192,9 +192,9 @@ function Feed() {
const {data, error, hasNextPage, isFetchingNextPage, fetchNextPage} =
usePostFeedQuery(
feedDesc,
params.type === 'feedgen' && params.feedCacheKey !== undefined
params.type === 'feedgen' && params.sourceInterstitial !== 'none'
? {
feedCacheKey: params.feedCacheKey,
feedCacheKey: params.sourceInterstitial,
}
: undefined,
)
+1 -1
View File
@@ -7,8 +7,8 @@ export type VideoFeedSourceContext =
| {
type: 'feedgen'
uri: string
sourceInterstitial: 'discover' | 'explore' | 'none'
initialPostUri?: string
feedCacheKey?: 'discover' | 'explore' | undefined
}
| {
type: 'author'
+2 -5
View File
@@ -14,10 +14,7 @@ import {msg} from '@lingui/macro'
import {useLingui} from '@lingui/react'
import {useQueryClient} from '@tanstack/react-query'
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 {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries'
import {useGate} from '#/lib/statsig/statsig'
@@ -655,7 +652,7 @@ let PostFeed = ({
sourceContext={{
type: 'feedgen',
uri: row.sourceFeedUri,
feedCacheKey: feedCacheKey,
sourceInterstitial: feedCacheKey ?? 'none',
}}
/>
)