about summary refs log tree commit diff
path: root/src/view/com/modals/ChangeHandle.tsx
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2023-11-16 18:26:22 -0800
committerGitHub <noreply@github.com>2023-11-16 18:26:22 -0800
commit357c752a213dbcf77e5333fa180cfef20a33842d (patch)
treee955e57cc1252b5fe759cde29185d62bb71bc339 /src/view/com/modals/ChangeHandle.tsx
parent3043b324681f1702ca53831701fb5cecd14c0efb (diff)
downloadvoidsky-357c752a213dbcf77e5333fa180cfef20a33842d.tar.zst
Move the current agent to a global and reset RQ queries on agent change (#1946)
Diffstat (limited to 'src/view/com/modals/ChangeHandle.tsx')
-rw-r--r--src/view/com/modals/ChangeHandle.tsx11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/view/com/modals/ChangeHandle.tsx b/src/view/com/modals/ChangeHandle.tsx
index da814b3d4..03516d35a 100644
--- a/src/view/com/modals/ChangeHandle.tsx
+++ b/src/view/com/modals/ChangeHandle.tsx
@@ -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}}>