Thread through threadgate record, validate approach
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user