Key post-source using URI with handle

This commit is contained in:
Eric Bailey
2025-06-10 17:38:54 -05:00
parent fc86badcc3
commit 3247c7e28f
3 changed files with 44 additions and 16 deletions
+7 -2
View File
@@ -40,7 +40,10 @@ import {useLanguagePrefs} from '#/state/preferences'
import {type ThreadPost} from '#/state/queries/post-thread'
import {useSession} from '#/state/session'
import {useMergedThreadgateHiddenReplies} from '#/state/threadgate-hidden-replies'
import {useUnstablePostSource} from '#/state/unstable-post-source'
import {
buildPostSourceUri,
useUnstablePostSource,
} from '#/state/unstable-post-source'
import {PostThreadFollowBtn} from '#/view/com/post-thread/PostThreadFollowBtn'
import {ErrorMessage} from '#/view/com/util/error/ErrorMessage'
import {Link, TextLink} from '#/view/com/util/Link'
@@ -204,7 +207,9 @@ let PostThreadItemLoaded = ({
threadgateRecord?: AppBskyFeedThreadgate.Record
}): React.ReactNode => {
const {currentAccount, hasSession} = useSession()
const source = useUnstablePostSource(post.uri)
const source = useUnstablePostSource(
buildPostSourceUri(post.uri, post.author.handle),
)
const feedFeedback = useFeedFeedback(source?.feed, hasSession)
const t = useTheme()
+5 -2
View File
@@ -36,7 +36,10 @@ import {useFeedFeedbackContext} from '#/state/feed-feedback'
import {unstableCacheProfileView} from '#/state/queries/profile'
import {useSession} from '#/state/session'
import {useMergedThreadgateHiddenReplies} from '#/state/threadgate-hidden-replies'
import {useSetUnstablePostSource} from '#/state/unstable-post-source'
import {
buildPostSourceUri,
useSetUnstablePostSource,
} from '#/state/unstable-post-source'
import {FeedNameText} from '#/view/com/util/FeedInfoText'
import {Link, TextLink, TextLinkOnWebOnly} from '#/view/com/util/Link'
import {PostEmbeds, PostEmbedViewContext} from '#/view/com/util/post-embeds'
@@ -232,7 +235,7 @@ let FeedItemInner = ({
reqId,
})
unstableCacheProfileView(queryClient, post.author)
unstableSetPostSource(post.uri, {
unstableSetPostSource(buildPostSourceUri(post.uri, post.author.handle), {
feed: feedDescriptor,
post: {
post,