Various search fixes (#2145)
* Add posts-search query to shadow cache search * Update user search to use correct endpoint * Fix: include cursor in post search
This commit is contained in:
parent
448a403c81
commit
7b50331188
5 changed files with 88 additions and 34 deletions
4
src/state/cache/post-shadow.ts
vendored
4
src/state/cache/post-shadow.ts
vendored
|
@ -6,6 +6,7 @@ import {Shadow, castAsShadow} from './types'
|
|||
import {findAllPostsInQueryData as findAllPostsInNotifsQueryData} from '../queries/notifications/feed'
|
||||
import {findAllPostsInQueryData as findAllPostsInFeedQueryData} from '../queries/post-feed'
|
||||
import {findAllPostsInQueryData as findAllPostsInThreadQueryData} from '../queries/post-thread'
|
||||
import {findAllPostsInQueryData as findAllPostsInSearchQueryData} from '../queries/search-posts'
|
||||
import {queryClient} from 'lib/react-query'
|
||||
export type {Shadow} from './types'
|
||||
|
||||
|
@ -98,4 +99,7 @@ function* findPostsInCache(
|
|||
yield node.post
|
||||
}
|
||||
}
|
||||
for (let post of findAllPostsInSearchQueryData(queryClient, uri)) {
|
||||
yield post
|
||||
}
|
||||
}
|
||||
|
|
2
src/state/cache/profile-shadow.ts
vendored
2
src/state/cache/profile-shadow.ts
vendored
|
@ -11,6 +11,7 @@ import {findAllProfilesInQueryData as findAllProfilesInProfileQueryData} from '.
|
|||
import {findAllProfilesInQueryData as findAllProfilesInProfileFollowersQueryData} from '../queries/profile-followers'
|
||||
import {findAllProfilesInQueryData as findAllProfilesInProfileFollowsQueryData} from '../queries/profile-follows'
|
||||
import {findAllProfilesInQueryData as findAllProfilesInSuggestedFollowsQueryData} from '../queries/suggested-follows'
|
||||
import {findAllProfilesInQueryData as findAllProfilesInActorSearchQueryData} from '../queries/actor-search'
|
||||
import {Shadow, castAsShadow} from './types'
|
||||
import {queryClient} from 'lib/react-query'
|
||||
export type {Shadow} from './types'
|
||||
|
@ -98,4 +99,5 @@ function* findProfilesInCache(did: string): Generator<ProfileView, void> {
|
|||
yield* findAllProfilesInProfileFollowersQueryData(queryClient, did)
|
||||
yield* findAllProfilesInProfileFollowsQueryData(queryClient, did)
|
||||
yield* findAllProfilesInSuggestedFollowsQueryData(queryClient, did)
|
||||
yield* findAllProfilesInActorSearchQueryData(queryClient, did)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue