diff options
author | Samuel Newman <mozzius@protonmail.com> | 2025-05-28 22:09:28 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-28 22:09:28 +0300 |
commit | cf63c2ca07c9a77bb92449ea4f3d78b8dd54fb8f (patch) | |
tree | 6136c729a77ef8daf3cbece566f4221c1b6a8d47 /src/view/com/posts | |
parent | 665a0430a3c04a3ad689954c5f930b4434daef79 (diff) | |
download | voidsky-cf63c2ca07c9a77bb92449ea4f3d78b8dd54fb8f.tar.zst |
Send FeedFeedback interactions in thread view (#8414)
Diffstat (limited to 'src/view/com/posts')
-rw-r--r-- | src/view/com/posts/PostFeedItem.tsx | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/src/view/com/posts/PostFeedItem.tsx b/src/view/com/posts/PostFeedItem.tsx index 3735bbb5a..b9aa67673 100644 --- a/src/view/com/posts/PostFeedItem.tsx +++ b/src/view/com/posts/PostFeedItem.tsx @@ -33,9 +33,10 @@ import { usePostShadow, } from '#/state/cache/post-shadow' import {useFeedFeedbackContext} from '#/state/feed-feedback' -import {precacheProfile} from '#/state/queries/profile' +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 {FeedNameText} from '#/view/com/util/FeedInfoText' import {Link, TextLink, TextLinkOnWebOnly} from '#/view/com/util/Link' import {PostEmbeds, PostEmbedViewContext} from '#/view/com/util/post-embeds' @@ -174,7 +175,8 @@ let FeedItemInner = ({ const urip = new AtUri(post.uri) return makeProfileLink(post.author, 'post', urip.rkey) }, [post.uri, post.author]) - const {sendInteraction} = useFeedFeedbackContext() + const {sendInteraction, feedDescriptor} = useFeedFeedbackContext() + const unstableSetPostSource = useSetUnstablePostSource() const onPressReply = () => { sendInteraction({ @@ -229,7 +231,16 @@ let FeedItemInner = ({ feedContext, reqId, }) - precacheProfile(queryClient, post.author) + unstableCacheProfileView(queryClient, post.author) + unstableSetPostSource(post.uri, { + feed: feedDescriptor, + post: { + post, + reason: AppBskyFeedDefs.isReasonRepost(reason) ? reason : undefined, + feedContext, + reqId, + }, + }) } const outerStyles = [ @@ -263,6 +274,15 @@ let FeedItemInner = ({ const {isActive: live} = useActorStatus(post.author) + const viaRepost = useMemo(() => { + if (AppBskyFeedDefs.isReasonRepost(reason) && reason.uri && reason.cid) { + return { + uri: reason.uri, + cid: reason.cid, + } + } + }, [reason]) + return ( <Link testID={`feedItem-by-${post.author.handle}`} @@ -450,6 +470,7 @@ let FeedItemInner = ({ reqId={reqId} threadgateRecord={threadgateRecord} onShowLess={onShowLess} + viaRepost={viaRepost} /> </View> |