Replace getAgent() with reading agent (#4243)
* Replace getAgent() with agent * Replace {agent} with agent
This commit is contained in:
parent
8a2f43c218
commit
9bd411c151
74 changed files with 400 additions and 438 deletions
|
@ -24,7 +24,7 @@ export function Deactivated() {
|
|||
const {gtMobile} = useBreakpoints()
|
||||
const onboardingDispatch = useOnboardingDispatch()
|
||||
const {logout} = useSessionApi()
|
||||
const {getAgent} = useAgent()
|
||||
const agent = useAgent()
|
||||
|
||||
const [isProcessing, setProcessing] = React.useState(false)
|
||||
const [estimatedTime, setEstimatedTime] = React.useState<string | undefined>(
|
||||
|
@ -37,11 +37,11 @@ export function Deactivated() {
|
|||
const checkStatus = React.useCallback(async () => {
|
||||
setProcessing(true)
|
||||
try {
|
||||
const res = await getAgent().com.atproto.temp.checkSignupQueue()
|
||||
const res = await agent.com.atproto.temp.checkSignupQueue()
|
||||
if (res.data.activated) {
|
||||
// ready to go, exchange the access token for a usable one and kick off onboarding
|
||||
await getAgent().refreshSession()
|
||||
if (!isSessionDeactivated(getAgent().session?.accessJwt)) {
|
||||
await agent.refreshSession()
|
||||
if (!isSessionDeactivated(agent.session?.accessJwt)) {
|
||||
onboardingDispatch({type: 'start'})
|
||||
}
|
||||
} else {
|
||||
|
@ -61,7 +61,7 @@ export function Deactivated() {
|
|||
setEstimatedTime,
|
||||
setPlaceInQueue,
|
||||
onboardingDispatch,
|
||||
getAgent,
|
||||
agent,
|
||||
])
|
||||
|
||||
React.useEffect(() => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue