Show hidden reply post alerts for FeedItems

This commit is contained in:
Eric Bailey
2024-08-14 16:10:04 -05:00
parent 9613c84e6a
commit e7e478b73d
2 changed files with 49 additions and 12 deletions
+6 -6
View File
@@ -207,12 +207,11 @@ let PostThreadItemLoaded = ({
return makeProfileLink(post.author, 'post', urip.rkey, 'reposted-by')
}, [post.uri, post.author])
const repostsTitle = _(msg`Reposts of this post`)
const isPostHiddenByThreadgate = threadgateRecord?.hiddenReplies?.includes(
post.uri,
)
// TODO memoize
const additionalPostAlerts: AppModerationCause[] =
threadgateRecord && isPostHiddenByThreadgate
const additionalPostAlerts: AppModerationCause[] = React.useMemo(() => {
const isPostHiddenByThreadgate = threadgateRecord?.hiddenReplies?.includes(
post.uri,
)
return threadgateRecord && isPostHiddenByThreadgate
? [
{
type: 'reply-hidden',
@@ -221,6 +220,7 @@ let PostThreadItemLoaded = ({
},
]
: []
}, [post, threadgateRecord])
const translatorUrl = getTranslatorLink(
record?.text || '',