Update API package to fix stale session issues (#9998)

This commit is contained in:
Eric Bailey
2026-03-04 18:27:12 -06:00
committed by GitHub
parent 8446efb739
commit 7fd218c97d
8 changed files with 19 additions and 39 deletions
+3 -5
View File
@@ -14,7 +14,6 @@ import {
useSession,
useSessionApi,
} from '#/state/session'
import {agentToSessionAccountOrThrow} from '#/state/session/agent'
import {useLoggedOutViewControls} from '#/state/shell/logged-out'
import {Logo} from '#/view/icons/Logo'
import {atoms as a, useTheme} from '#/alf'
@@ -37,7 +36,7 @@ export function Deactivated() {
const {onPressSwitchAccount, pendingDid} = useAccountSwitcher()
const {setShowLoggedOut} = useLoggedOutViewControls()
const hasOtherAccounts = accounts.length > 1
const {logoutCurrentAccount, resumeSession} = useSessionApi()
const {logoutCurrentAccount} = useSessionApi()
const agent = useAgent()
const [pending, setPending] = React.useState(false)
const [error, setError] = React.useState<string | undefined>()
@@ -73,8 +72,7 @@ export function Deactivated() {
setPending(true)
await agent.com.atproto.server.activateAccount()
await queryClient.resetQueries()
const account = agentToSessionAccountOrThrow(agent)
await resumeSession({...account, active: true, status: undefined})
await agent.resumeSession(agent.session!)
} catch (e: any) {
switch (e.message) {
case 'Bad token scope':
@@ -95,7 +93,7 @@ export function Deactivated() {
} finally {
setPending(false)
}
}, [_, agent, queryClient, resumeSession])
}, [_, agent, setPending, setError, queryClient])
return (
<View style={[a.util_screen_outer, a.flex_1]}>