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