Bluesky app fork with some witchin' additions 💫 witchsky.app
bluesky fork client

ensure app session state refreshes on reactivation (#9954)

Co-authored-by: Samuel Newman <mozzius@protonmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

authored by

Spence Pope
Samuel Newman
Claude Opus 4.6
and committed by
GitHub
398df1a4 db9c2a15

+5 -3
+5 -3
src/screens/Deactivated.tsx
··· 14 14 useSession, 15 15 useSessionApi, 16 16 } from '#/state/session' 17 + import {agentToSessionAccountOrThrow} from '#/state/session/agent' 17 18 import {useLoggedOutViewControls} from '#/state/shell/logged-out' 18 19 import {Logo} from '#/view/icons/Logo' 19 20 import {atoms as a, useTheme} from '#/alf' ··· 36 37 const {onPressSwitchAccount, pendingDid} = useAccountSwitcher() 37 38 const {setShowLoggedOut} = useLoggedOutViewControls() 38 39 const hasOtherAccounts = accounts.length > 1 39 - const {logoutCurrentAccount} = useSessionApi() 40 + const {logoutCurrentAccount, resumeSession} = useSessionApi() 40 41 const agent = useAgent() 41 42 const [pending, setPending] = React.useState(false) 42 43 const [error, setError] = React.useState<string | undefined>() ··· 72 73 setPending(true) 73 74 await agent.com.atproto.server.activateAccount() 74 75 await queryClient.resetQueries() 75 - await agent.resumeSession(agent.session!) 76 + const account = agentToSessionAccountOrThrow(agent) 77 + await resumeSession({...account, active: true, status: undefined}) 76 78 } catch (e: any) { 77 79 switch (e.message) { 78 80 case 'Bad token scope': ··· 93 95 } finally { 94 96 setPending(false) 95 97 } 96 - }, [_, agent, setPending, setError, queryClient]) 98 + }, [_, agent, queryClient, resumeSession]) 97 99 98 100 return ( 99 101 <View style={[a.util_screen_outer, a.flex_1]}>