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

@ -26,19 +26,24 @@ import {useLingui} from '@lingui/react'
import {useModalControls} from '#/state/modals'
import {useServiceQuery} from '#/state/queries/service'
import {useUpdateHandleMutation, useFetchDid} from '#/state/queries/handle'
import {useSession, useSessionApi, SessionAccount} from '#/state/session'
import {
useSession,
useSessionApi,
SessionAccount,
getAgent,
} from '#/state/session'
export const snapPoints = ['100%']
export type Props = {onChanged: () => void}
export function Component(props: Props) {
const {agent, currentAccount} = useSession()
const {currentAccount} = useSession()
const {
isLoading,
data: serviceInfo,
error: serviceInfoError,
} = useServiceQuery(agent.service.toString())
} = useServiceQuery(getAgent().service.toString())
return isLoading || !currentAccount ? (
<View style={{padding: 18}}>