diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-11-16 18:26:22 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-16 18:26:22 -0800 |
commit | 357c752a213dbcf77e5333fa180cfef20a33842d (patch) | |
tree | e955e57cc1252b5fe759cde29185d62bb71bc339 /src/state/queries/my-muted-accounts.ts | |
parent | 3043b324681f1702ca53831701fb5cecd14c0efb (diff) | |
download | voidsky-357c752a213dbcf77e5333fa180cfef20a33842d.tar.zst |
Move the current agent to a global and reset RQ queries on agent change (#1946)
Diffstat (limited to 'src/state/queries/my-muted-accounts.ts')
-rw-r--r-- | src/state/queries/my-muted-accounts.ts | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/state/queries/my-muted-accounts.ts b/src/state/queries/my-muted-accounts.ts index c46474b27..1d686637a 100644 --- a/src/state/queries/my-muted-accounts.ts +++ b/src/state/queries/my-muted-accounts.ts @@ -1,14 +1,13 @@ import {AppBskyGraphGetMutes} 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' export const RQKEY = () => ['my-muted-accounts'] type RQPageParam = string | undefined export function useMyMutedAccountsQuery() { - const {agent} = useSession() return useInfiniteQuery< AppBskyGraphGetMutes.OutputSchema, Error, @@ -19,7 +18,7 @@ export function useMyMutedAccountsQuery() { staleTime: STALE.MINUTES.ONE, queryKey: RQKEY(), async queryFn({pageParam}: {pageParam: RQPageParam}) { - const res = await agent.app.bsky.graph.getMutes({ + const res = await getAgent().app.bsky.graph.getMutes({ limit: 30, cursor: pageParam, }) |