From 398df1a4b51fb6d3d7145445173992781a1c0730 Mon Sep 17 00:00:00 2001 From: Spence Pope Date: Thu, 26 Feb 2026 05:06:16 -0500 Subject: [PATCH] ensure app session state refreshes on reactivation (#9954) Co-authored-by: Samuel Newman Co-authored-by: Claude Opus 4.6 --- src/screens/Deactivated.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/screens/Deactivated.tsx b/src/screens/Deactivated.tsx index 9500f27a2b..363151bd80 100644 --- a/src/screens/Deactivated.tsx +++ b/src/screens/Deactivated.tsx @@ -14,6 +14,7 @@ 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' @@ -36,7 +37,7 @@ export function Deactivated() { const {onPressSwitchAccount, pendingDid} = useAccountSwitcher() const {setShowLoggedOut} = useLoggedOutViewControls() const hasOtherAccounts = accounts.length > 1 - const {logoutCurrentAccount} = useSessionApi() + const {logoutCurrentAccount, resumeSession} = useSessionApi() const agent = useAgent() const [pending, setPending] = React.useState(false) const [error, setError] = React.useState() @@ -72,7 +73,8 @@ export function Deactivated() { setPending(true) await agent.com.atproto.server.activateAccount() await queryClient.resetQueries() - await agent.resumeSession(agent.session!) + const account = agentToSessionAccountOrThrow(agent) + await resumeSession({...account, active: true, status: undefined}) } catch (e: any) { switch (e.message) { case 'Bad token scope': @@ -93,7 +95,7 @@ export function Deactivated() { } finally { setPending(false) } - }, [_, agent, setPending, setError, queryClient]) + }, [_, agent, queryClient, resumeSession]) return (