Prefer post over quote when finding cached post (#2935)
parent
2e132a7a01
commit
da62a77f05
|
@ -391,6 +391,9 @@ export function* findAllPostsInQueryData(
|
|||
>({
|
||||
queryKey: ['post-feed'],
|
||||
})
|
||||
|
||||
let foundEmbed: AppBskyFeedDefs.PostView | undefined
|
||||
|
||||
for (const [_queryKey, queryData] of queryDatas) {
|
||||
if (!queryData?.pages) {
|
||||
continue
|
||||
|
@ -402,7 +405,7 @@ export function* findAllPostsInQueryData(
|
|||
}
|
||||
const quotedPost = getEmbeddedPost(item.post.embed)
|
||||
if (quotedPost?.uri === uri) {
|
||||
yield embedViewRecordToPostView(quotedPost)
|
||||
foundEmbed = embedViewRecordToPostView(quotedPost)
|
||||
}
|
||||
if (
|
||||
AppBskyFeedDefs.isPostView(item.reply?.parent) &&
|
||||
|
@ -419,6 +422,10 @@ export function* findAllPostsInQueryData(
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (foundEmbed) {
|
||||
yield foundEmbed
|
||||
}
|
||||
}
|
||||
|
||||
function assertSomePostsPassModeration(feed: AppBskyFeedDefs.FeedViewPost[]) {
|
||||
|
|
Loading…
Reference in New Issue