Use actual typecast, better name for feedUri

This commit is contained in:
Eric Bailey
2025-01-21 17:03:57 -06:00
parent c41e68b149
commit b640760df1
+10 -9
View File
@@ -25,6 +25,7 @@ import {useFeedFeedbackContext} from '#/state/feed-feedback'
import {useTrendingSettings} from '#/state/preferences/trending'
import {STALE} from '#/state/queries'
import {
AuthorFilter,
FeedDescriptor,
FeedParams,
FeedPostSlice,
@@ -195,7 +196,7 @@ let PostFeed = ({
const [isPTRing, setIsPTRing] = React.useState(false)
const checkForNewRef = React.useRef<(() => void) | null>(null)
const lastFetchRef = React.useRef<number>(Date.now())
const [feedType, feedUri, feedTab] = feed.split('|')
const [feedType, feedUriOrActorDid, feedTab] = feed.split('|')
const {gtMobile, gtTablet} = useBreakpoints()
const areVideoFeedsEnabled = isNative
@@ -308,7 +309,7 @@ let PostFeed = ({
let feedKind: 'following' | 'discover' | 'profile' | 'thevids' | undefined
if (feedType === 'following') {
feedKind = 'following'
} else if (feedUri === DISCOVER_FEED_URI) {
} else if (feedUriOrActorDid === DISCOVER_FEED_URI) {
feedKind = 'discover'
} else if (
feedType === 'author' &&
@@ -319,7 +320,7 @@ let PostFeed = ({
}
let arr: FeedRow[] = []
if (KNOWN_SHUTDOWN_FEEDS.includes(feedUri)) {
if (KNOWN_SHUTDOWN_FEEDS.includes(feedUriOrActorDid)) {
arr.push({
type: 'feedShutdownMsg',
key: 'feedShutdownMsg',
@@ -377,7 +378,7 @@ let PostFeed = ({
type: 'videoGridRow',
key: row.map(r => r.item._reactKey).join('-'),
items: row.map(r => r.item),
sourceFeedUri: feedUri,
sourceFeedUri: feedUriOrActorDid,
feedContexts: row.map(r => r.feedContext),
})
}
@@ -505,7 +506,7 @@ let PostFeed = ({
lastFetchedAt,
data,
feedType,
feedUri,
feedUriOrActorDid,
feedTab,
hasSession,
showProgressIntersitial,
@@ -596,7 +597,7 @@ let PostFeed = ({
} else if (row.type === 'loading') {
return <PostFeedLoadingPlaceholder />
} else if (row.type === 'feedShutdownMsg') {
return <FeedShutdownMsg feedUri={feedUri} />
return <FeedShutdownMsg feedUri={feedUriOrActorDid} />
} else if (row.type === 'interstitialFollows') {
return <SuggestedFollows feed={feed} />
} else if (row.type === 'interstitialProgressGuide') {
@@ -656,8 +657,8 @@ let PostFeed = ({
if (feedType === 'author') {
sourceContext = {
type: 'author',
did: feedUri,
filter: feedTab as any,
did: feedUriOrActorDid,
filter: feedTab as AuthorFilter,
sourceInterstitial: 'none',
}
}
@@ -681,7 +682,7 @@ let PostFeed = ({
_,
onPressRetryLoadMore,
feedType,
feedUri,
feedUriOrActorDid,
feedTab,
feedCacheKey,
],