Skip to content

Commit

Permalink
Use entryway for labeler getServices (#3256)
Browse files Browse the repository at this point in the history
  • Loading branch information
pfrazee authored Mar 18, 2024
1 parent 20d463f commit 1b10c7b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/state/queries/labeler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {AppBskyLabelerDefs} from '@atproto/api'

import {getAgent} from '#/state/session'
import {preferencesQueryKey} from '#/state/queries/preferences'
import {STALE, PUBLIC_BSKY_AGENT} from '#/state/queries'
import {STALE} from '#/state/queries'

export const labelerInfoQueryKey = (did: string) => ['labeler-info', did]
export const labelersInfoQueryKey = (dids: string[]) => [
Expand All @@ -27,7 +27,7 @@ export function useLabelerInfoQuery({
enabled: !!did && enabled !== false,
queryKey: labelerInfoQueryKey(did as string),
queryFn: async () => {
const res = await PUBLIC_BSKY_AGENT.app.bsky.labeler.getServices({
const res = await getAgent().app.bsky.labeler.getServices({
dids: [did as string],
detailed: true,
})
Expand All @@ -41,7 +41,7 @@ export function useLabelersInfoQuery({dids}: {dids: string[]}) {
enabled: !!dids.length,
queryKey: labelersInfoQueryKey(dids),
queryFn: async () => {
const res = await PUBLIC_BSKY_AGENT.app.bsky.labeler.getServices({dids})
const res = await getAgent().app.bsky.labeler.getServices({dids})
return res.data.views as AppBskyLabelerDefs.LabelerView[]
},
})
Expand All @@ -54,7 +54,7 @@ export function useLabelersDetailedInfoQuery({dids}: {dids: string[]}) {
gcTime: 1000 * 60 * 60 * 6, // 6 hours
staleTime: STALE.MINUTES.ONE,
queryFn: async () => {
const res = await PUBLIC_BSKY_AGENT.app.bsky.labeler.getServices({
const res = await getAgent().app.bsky.labeler.getServices({
dids,
detailed: true,
})
Expand Down

0 comments on commit 1b10c7b

Please sign in to comment.