diff --git a/src/view/com/posts/FeedItem.tsx b/src/view/com/posts/FeedItem.tsx index 8592f0bec2..28264a2443 100644 --- a/src/view/com/posts/FeedItem.tsx +++ b/src/view/com/posts/FeedItem.tsx @@ -4,6 +4,7 @@ import { AppBskyActorDefs, AppBskyFeedDefs, AppBskyFeedPost, + AppBskyFeedThreadgate, AtUri, ModerationDecision, RichText as RichTextAPI, @@ -78,7 +79,11 @@ export function FeedItem({ isThreadParent, hideTopBorder, isParentBlocked, -}: FeedItemProps & {post: AppBskyFeedDefs.PostView}): React.ReactNode { + rootPost, +}: FeedItemProps & { + post: AppBskyFeedDefs.PostView + rootPost?: AppBskyFeedDefs.PostView +}): React.ReactNode { const postShadowed = usePostShadow(post) const richText = useMemo( () => @@ -109,6 +114,7 @@ export function FeedItem({ isThreadParent={isThreadParent} hideTopBorder={hideTopBorder} isParentBlocked={isParentBlocked} + rootPost={rootPost} /> ) } @@ -129,9 +135,11 @@ let FeedItemInner = ({ isThreadParent, hideTopBorder, isParentBlocked, + rootPost, }: FeedItemProps & { richText: RichTextAPI post: Shadow + rootPost?: AppBskyFeedDefs.PostView }): React.ReactNode => { const queryClient = useQueryClient() const {openComposer} = useComposerControls() @@ -366,6 +374,11 @@ let FeedItemInner = ({ onPressReply={onPressReply} logContext="FeedItem" feedContext={feedContext} + threadgateRecord={ + AppBskyFeedThreadgate.isRecord(rootPost?.threadgate?.record) + ? rootPost.threadgate.record + : undefined + } /> diff --git a/src/view/com/posts/FeedSlice.tsx b/src/view/com/posts/FeedSlice.tsx index fcd1ec3b18..d1ed2d2d42 100644 --- a/src/view/com/posts/FeedSlice.tsx +++ b/src/view/com/posts/FeedSlice.tsx @@ -36,6 +36,7 @@ let FeedSlice = ({ isThreadChild={isThreadChildAt(slice.items, 0)} hideTopBorder={hideTopBorder} isParentBlocked={slice.items[0].isParentBlocked} + rootPost={slice.items[0].post} /> ) @@ -91,6 +94,7 @@ let FeedSlice = ({ } isParentBlocked={slice.items[i].isParentBlocked} hideTopBorder={hideTopBorder && i === 0} + rootPost={slice.items[0].post} /> ))} diff --git a/src/view/com/util/forms/PostDropdownBtn.tsx b/src/view/com/util/forms/PostDropdownBtn.tsx index 4e5bb5a89f..7958a23735 100644 --- a/src/view/com/util/forms/PostDropdownBtn.tsx +++ b/src/view/com/util/forms/PostDropdownBtn.tsx @@ -146,8 +146,8 @@ let PostDropdownBtn = ({ const isAuthor = postAuthor.did === currentAccount?.did const isRootPostAuthor = new AtUri(rootUri).host === currentAccount?.did const isReplyHiddenByThreadgate = - threadgateRecord?.hiddenReplies?.includes(postUri) || - hiddenReplies.includes(postUri) + hiddenReplies.includes(postUri) || + threadgateRecord?.hiddenReplies?.includes(postUri) const {mutateAsync: toggleQuoteDetachment, isPending} = useToggleQuoteDetachmentMutation()