diff options
Diffstat (limited to 'src/state/queries/profile-follows.ts')
-rw-r--r-- | src/state/queries/profile-follows.ts | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/state/queries/profile-follows.ts b/src/state/queries/profile-follows.ts index 71c51993d..8af1fba07 100644 --- a/src/state/queries/profile-follows.ts +++ b/src/state/queries/profile-follows.ts @@ -1,7 +1,7 @@ import {AppBskyGraphGetFollows} from '@atproto/api' import {useInfiniteQuery, InfiniteData, QueryKey} from '@tanstack/react-query' -import {useSession} from '#/state/session' +import {getAgent} from '#/state/session' import {STALE} from '#/state/queries' const PAGE_SIZE = 30 @@ -11,7 +11,6 @@ type RQPageParam = string | undefined export const RQKEY = (did: string) => ['profile-follows', did] export function useProfileFollowsQuery(did: string | undefined) { - const {agent} = useSession() return useInfiniteQuery< AppBskyGraphGetFollows.OutputSchema, Error, @@ -22,7 +21,7 @@ export function useProfileFollowsQuery(did: string | undefined) { staleTime: STALE.MINUTES.ONE, queryKey: RQKEY(did || ''), async queryFn({pageParam}: {pageParam: RQPageParam}) { - const res = await agent.app.bsky.graph.getFollows({ + const res = await getAgent().app.bsky.graph.getFollows({ actor: did || '', limit: PAGE_SIZE, cursor: pageParam, |