Just kidding, use ReplyRef.root as source of grandparent data
This commit is contained in:
@@ -92,7 +92,14 @@ export class FeedViewPostsSlice {
|
|||||||
this.isOrphan = true
|
this.isOrphan = true
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const grandparent = reply?.grandparent
|
const root = reply.root
|
||||||
|
const rootIsView =
|
||||||
|
AppBskyFeedDefs.isPostView(root) || AppBskyFeedDefs.isBlockedPost(root)
|
||||||
|
// if parent is also the root, we have data!
|
||||||
|
const grandparent =
|
||||||
|
rootIsView && parent?.record?.reply?.parent?.uri === root?.uri
|
||||||
|
? reply?.root
|
||||||
|
: undefined
|
||||||
const grandparentAuthor = reply.grandparentAuthor
|
const grandparentAuthor = reply.grandparentAuthor
|
||||||
const isGrandparentBlocked = Boolean(
|
const isGrandparentBlocked = Boolean(
|
||||||
grandparent && AppBskyFeedDefs.isBlockedPost(grandparent),
|
grandparent && AppBskyFeedDefs.isBlockedPost(grandparent),
|
||||||
@@ -112,7 +119,6 @@ export class FeedViewPostsSlice {
|
|||||||
// Keep going, it might still have a root, and we need this for thread
|
// Keep going, it might still have a root, and we need this for thread
|
||||||
// de-deduping
|
// de-deduping
|
||||||
}
|
}
|
||||||
const root = reply.root
|
|
||||||
if (
|
if (
|
||||||
!AppBskyFeedDefs.isPostView(root) ||
|
!AppBskyFeedDefs.isPostView(root) ||
|
||||||
!AppBskyFeedPost.isRecord(root.record) ||
|
!AppBskyFeedPost.isRecord(root.record) ||
|
||||||
|
|||||||
Reference in New Issue
Block a user