update endpoint

This commit is contained in:
vineyardbovines
2026-04-14 08:54:10 -04:00
parent e14dd07c7c
commit 3ca86add4e
2 changed files with 3 additions and 63 deletions
@@ -15,7 +15,6 @@ import {useAgent} from '#/state/session'
export type QueryProps = {
limit?: number
enabled?: boolean
}
export const getSuggestedUsersForDiscoverQueryKeyRoot =
@@ -29,7 +28,6 @@ export function useGetSuggestedUsersForDiscoverQuery(props: QueryProps = {}) {
const {data: preferences} = usePreferencesQuery()
return useQuery({
enabled: props.enabled ?? true,
staleTime: STALE.MINUTES.THREE,
queryKey: createGetSuggestedUsersForDiscoverQueryKey({limit: props.limit}),
queryFn: async () => {
@@ -75,33 +73,3 @@ export function* findAllProfilesInQueryData(
}
}
}
/**
* Collects every DID currently cached under any `getSuggestedUsersForDiscover`
* query. Used by the See More dialog's For You tab to filter out profiles the
* viewer has already been shown by the home-feed interstitial (the endpoint
* has no cursor/offset, so we dedup client-side).
*
* The query key root is shared with `getSuggestedUsersForSeeMore`, so we
* narrow by key length (Discover keys are `[root, limit]`, SeeMore keys are
* `[root, category, limit]`).
*/
export function getAllDidsInDiscoverCache(
queryClient: QueryClient,
): Set<string> {
const dids = new Set<string>()
const responses =
queryClient.getQueriesData<AppBskyUnspeccedGetSuggestedUsersForDiscover.OutputSchema>(
{
queryKey: [getSuggestedUsersForDiscoverQueryKeyRoot],
},
)
for (const [key, response] of responses) {
if (!response) continue
if (key.length !== 2) continue
for (const actor of response.actors) {
dids.add(actor.did)
}
}
return dids
}