update `usePostThreadQuery` to check quote query data (#4975)

* update `usePostThreadQuery` to check quote query data

* search notifs before quotes

* oops
zio/stable
Hailey 2024-08-22 11:11:51 -07:00 committed by GitHub
parent 92989282ae
commit df5bf28e61
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View File

@ -75,8 +75,8 @@ export async function getAllListMembers(agent: BskyAgent, uri: string) {
listItems.push(...res.data.items) listItems.push(...res.data.items)
hasMore = Boolean(res.data.cursor) hasMore = Boolean(res.data.cursor)
cursor = res.data.cursor cursor = res.data.cursor
i++
} }
i++
return listItems return listItems
} }

View File

@ -13,6 +13,7 @@ import {QueryClient, useQuery, useQueryClient} from '@tanstack/react-query'
import {moderatePost_wrapped as moderatePost} from '#/lib/moderatePost_wrapped' import {moderatePost_wrapped as moderatePost} from '#/lib/moderatePost_wrapped'
import {UsePreferencesQueryResponse} from '#/state/queries/preferences/types' import {UsePreferencesQueryResponse} from '#/state/queries/preferences/types'
import {useAgent} from '#/state/session' import {useAgent} from '#/state/session'
import {findAllPostsInQueryData as findAllPostsInQuoteQueryData} from 'state/queries/post-quotes'
import { import {
findAllPostsInQueryData as findAllPostsInSearchQueryData, findAllPostsInQueryData as findAllPostsInSearchQueryData,
findAllProfilesInQueryData as findAllProfilesInSearchQueryData, findAllProfilesInQueryData as findAllProfilesInSearchQueryData,
@ -402,6 +403,9 @@ export function* findAllPostsInQueryData(
for (let post of findAllPostsInNotifsQueryData(queryClient, uri)) { for (let post of findAllPostsInNotifsQueryData(queryClient, uri)) {
yield postViewToPlaceholderThread(post) yield postViewToPlaceholderThread(post)
} }
for (let post of findAllPostsInQuoteQueryData(queryClient, uri)) {
yield postViewToPlaceholderThread(post)
}
for (let post of findAllPostsInSearchQueryData(queryClient, uri)) { for (let post of findAllPostsInSearchQueryData(queryClient, uri)) {
yield postViewToPlaceholderThread(post) yield postViewToPlaceholderThread(post)
} }