diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-11-16 18:26:22 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-16 18:26:22 -0800 |
commit | 357c752a213dbcf77e5333fa180cfef20a33842d (patch) | |
tree | e955e57cc1252b5fe759cde29185d62bb71bc339 /src/view/com/modals/VerifyEmail.tsx | |
parent | 3043b324681f1702ca53831701fb5cecd14c0efb (diff) | |
download | voidsky-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/VerifyEmail.tsx')
-rw-r--r-- | src/view/com/modals/VerifyEmail.tsx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/view/com/modals/VerifyEmail.tsx b/src/view/com/modals/VerifyEmail.tsx index e7a4537c5..0af02db4b 100644 --- a/src/view/com/modals/VerifyEmail.tsx +++ b/src/view/com/modals/VerifyEmail.tsx @@ -21,7 +21,7 @@ import {cleanError} from 'lib/strings/errors' import {Trans, msg} from '@lingui/macro' import {useLingui} from '@lingui/react' import {useModalControls} from '#/state/modals' -import {useSession, useSessionApi} from '#/state/session' +import {useSession, useSessionApi, getAgent} from '#/state/session' export const snapPoints = ['90%'] @@ -33,7 +33,7 @@ enum Stages { export function Component({showReminder}: {showReminder?: boolean}) { const pal = usePalette('default') - const {agent, currentAccount} = useSession() + const {currentAccount} = useSession() const {updateCurrentAccount} = useSessionApi() const {_} = useLingui() const [stage, setStage] = useState<Stages>( @@ -49,7 +49,7 @@ export function Component({showReminder}: {showReminder?: boolean}) { setError('') setIsProcessing(true) try { - await agent.com.atproto.server.requestEmailConfirmation() + await getAgent().com.atproto.server.requestEmailConfirmation() setStage(Stages.ConfirmCode) } catch (e) { setError(cleanError(String(e))) @@ -62,7 +62,7 @@ export function Component({showReminder}: {showReminder?: boolean}) { setError('') setIsProcessing(true) try { - await agent.com.atproto.server.confirmEmail({ + await getAgent().com.atproto.server.confirmEmail({ email: (currentAccount?.email || '').trim(), token: confirmationCode.trim(), }) |