Merge pull request #8885 from internet-development/caidanw/app-1409-add-data-nosnippet-to-discover-feed
feat: prevent search engines from using Discover feed content as page descriptions
This commit is contained in:
@@ -6,7 +6,7 @@ import {useLingui} from '@lingui/react'
|
||||
import {type NavigationProp, useNavigation} from '@react-navigation/native'
|
||||
import {useQueryClient} from '@tanstack/react-query'
|
||||
|
||||
import {VIDEO_FEED_URIS} from '#/lib/constants'
|
||||
import {DISCOVER_FEED_URI, VIDEO_FEED_URIS} from '#/lib/constants'
|
||||
import {useOpenComposer} from '#/lib/hooks/useOpenComposer'
|
||||
import {ComposeIcon2} from '#/lib/icons'
|
||||
import {getRootNavigation, getTabState, TabState} from '#/lib/routes/helpers'
|
||||
@@ -18,8 +18,11 @@ import {listenSoftReset} from '#/state/events'
|
||||
import {FeedFeedbackProvider, useFeedFeedback} from '#/state/feed-feedback'
|
||||
import {useSetHomeBadge} from '#/state/home-badge'
|
||||
import {type FeedSourceInfo} from '#/state/queries/feed'
|
||||
import {RQKEY as FEED_RQKEY} from '#/state/queries/post-feed'
|
||||
import {type FeedDescriptor, type FeedParams} from '#/state/queries/post-feed'
|
||||
import {
|
||||
type FeedDescriptor,
|
||||
type FeedParams,
|
||||
RQKEY as FEED_RQKEY,
|
||||
} from '#/state/queries/post-feed'
|
||||
import {truncateAndInvalidate} from '#/state/queries/util'
|
||||
import {useSession} from '#/state/session'
|
||||
import {useSetMinimalShellMode} from '#/state/shell'
|
||||
@@ -127,8 +130,12 @@ export function FeedPage({
|
||||
}, [scrollToTop, feed, queryClient])
|
||||
|
||||
const shouldPrefetch = isNative && isPageAdjacent
|
||||
const isDiscoverFeed = feedInfo.uri === DISCOVER_FEED_URI
|
||||
return (
|
||||
<View testID={testID}>
|
||||
<View
|
||||
testID={testID}
|
||||
// @ts-expect-error web only -sfn
|
||||
dataSet={{nosnippet: isDiscoverFeed ? '' : undefined}}>
|
||||
<MainScrollProvider>
|
||||
<FeedFeedbackProvider value={feedFeedback}>
|
||||
<PostFeed
|
||||
|
||||
Reference in New Issue
Block a user