FIX potential bug in post-thread

This commit is contained in:
Eric Bailey
2025-01-03 09:25:53 -06:00
parent 220ff2ff25
commit 8a61a4297f
+2 -3
View File
@@ -329,8 +329,7 @@ function responseToThreadNodes(
): ThreadNode { ): ThreadNode {
if ( if (
AppBskyFeedDefs.isThreadViewPost(node) && AppBskyFeedDefs.isThreadViewPost(node) &&
AppBskyFeedPost.isRecord(node.post.record) && AppBskyFeedPost.isValidRecord(node.post.record)
AppBskyFeedPost.validateRecord(node.post.record).success
) { ) {
const post = node.post const post = node.post
// These should normally be present. They're missing only for // These should normally be present. They're missing only for
@@ -360,7 +359,7 @@ function responseToThreadNodes(
depth, depth,
isHighlightedPost: depth === 0, isHighlightedPost: depth === 0,
hasMore: hasMore:
direction === 'down' && !node.replies?.length && !!node.replyCount, direction === 'down' && !node.replies?.length && !!post.replyCount,
isSelfThread: false, // populated `annotateSelfThread` isSelfThread: false, // populated `annotateSelfThread`
hasMoreSelfThread: false, // populated in `annotateSelfThread` hasMoreSelfThread: false, // populated in `annotateSelfThread`
}, },