Thread through threadgate record, validate approach

This commit is contained in:
Eric Bailey
2024-08-05 09:55:59 -05:00
parent 380c4dbf24
commit 571d00cf41
5 changed files with 64 additions and 3 deletions
+5 -1
View File
@@ -119,7 +119,7 @@ export function PostThread({
const rootPostRecord = thread?.type === 'post' ? thread.record : undefined
const {data: threadgateRecord} = useThreadgateRecordQuery({
postUri: uri,
postUri: rootPost?.record?.reply?.root?.uri,
initialData: rootPost?.threadgate?.record as AppBskyFeedThreadgate.Record,
})
@@ -572,6 +572,10 @@ function* flattenThreadReplies(
return HiddenReplyType.Hidden
}
}
if (threadgateRecord?.hiddenReplies?.includes(node.post.uri)) {
return HiddenReplyType.Hidden
}
}
if (!node.ctx.isHighlightedPost) {
@@ -392,6 +392,7 @@ let PostThreadItemLoaded = ({
richText={richText}
onPressReply={onPressReply}
logContext="PostThreadItem"
rootPostUri={rootUri}
/>
</View>
</View>
@@ -543,6 +544,7 @@ let PostThreadItemLoaded = ({
richText={richText}
onPressReply={onPressReply}
logContext="PostThreadItem"
rootPostUri={rootUri}
/>
</View>
</View>