Perf: Include quote posts in the post-thread placeholder (#2104)

This commit is contained in:
Paul Frazee 2023-12-05 18:17:03 -08:00 committed by GitHub
parent accb25ccf2
commit 712cd3fde5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 96 additions and 1 deletions

View file

@ -23,6 +23,7 @@ import {getAgent} from '#/state/session'
import {DEFAULT_LOGGED_OUT_PREFERENCES} from '#/state/queries/preferences/const'
import {getModerationOpts} from '#/state/queries/preferences/moderation'
import {KnownError} from '#/view/com/posts/FeedErrorMessage'
import {embedViewRecordToPostView, getEmbeddedPost} from './util'
type ActorDid = string
type AuthorFilter =
@ -263,6 +264,10 @@ export function* findAllPostsInQueryData(
if (item.post.uri === uri) {
yield item.post
}
const quotedPost = getEmbeddedPost(item.post.embed)
if (quotedPost?.uri === uri) {
yield embedViewRecordToPostView(quotedPost)
}
if (
AppBskyFeedDefs.isPostView(item.reply?.parent) &&
item.reply?.parent?.uri === uri