Move the current agent to a global and reset RQ queries on agent change (#1946)

This commit is contained in:
Paul Frazee 2023-11-16 18:26:22 -08:00 committed by GitHub
parent 3043b32468
commit 357c752a21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
40 changed files with 218 additions and 260 deletions

View file

@ -16,7 +16,7 @@ import {CollectionId} from './types'
import {Trans, msg} from '@lingui/macro'
import {useLingui} from '@lingui/react'
import {useModalControls} from '#/state/modals'
import {useSession} from '#/state/session'
import {getAgent} from '#/state/session'
const DMCA_LINK = 'https://blueskyweb.xyz/support/copyright'
@ -39,7 +39,6 @@ type ReportComponentProps =
}
export function Component(content: ReportComponentProps) {
const {agent} = useSession()
const {closeModal} = useModalControls()
const pal = usePalette('default')
const {isMobile} = useWebMediaQueries()
@ -70,7 +69,7 @@ export function Component(content: ReportComponentProps) {
const $type = !isAccountReport
? 'com.atproto.repo.strongRef'
: 'com.atproto.admin.defs#repoRef'
await agent.createModerationReport({
await getAgent().createModerationReport({
reasonType: issue,
subject: {
$type,