about summary refs log tree commit diff
path: root/src/view/screens/Settings/DisableEmail2FADialog.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/view/screens/Settings/DisableEmail2FADialog.tsx')
-rw-r--r--src/view/screens/Settings/DisableEmail2FADialog.tsx8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/view/screens/Settings/DisableEmail2FADialog.tsx b/src/view/screens/Settings/DisableEmail2FADialog.tsx
index b52dcc7a3..a27cff9a3 100644
--- a/src/view/screens/Settings/DisableEmail2FADialog.tsx
+++ b/src/view/screens/Settings/DisableEmail2FADialog.tsx
@@ -30,7 +30,7 @@ export function DisableEmail2FADialog({
   const t = useTheme()
   const {gtMobile} = useBreakpoints()
   const {currentAccount} = useSession()
-  const {getAgent} = useAgent()
+  const agent = useAgent()
 
   const [stage, setStage] = useState<Stages>(Stages.Email)
   const [confirmationCode, setConfirmationCode] = useState<string>('')
@@ -41,7 +41,7 @@ export function DisableEmail2FADialog({
     setError('')
     setIsProcessing(true)
     try {
-      await getAgent().com.atproto.server.requestEmailUpdate()
+      await agent.com.atproto.server.requestEmailUpdate()
       setStage(Stages.ConfirmCode)
     } catch (e) {
       setError(cleanError(String(e)))
@@ -55,12 +55,12 @@ export function DisableEmail2FADialog({
     setIsProcessing(true)
     try {
       if (currentAccount?.email) {
-        await getAgent().com.atproto.server.updateEmail({
+        await agent.com.atproto.server.updateEmail({
           email: currentAccount!.email,
           token: confirmationCode.trim(),
           emailAuthFactor: false,
         })
-        await getAgent().resumeSession(getAgent().session!)
+        await agent.resumeSession(agent.session!)
         Toast.show(_(msg`Email 2FA disabled`))
       }
       control.close()