Revert "ensure app session state refreshes on reactivation (#9954)"
This reverts commit 398df1a4b5.
This commit is contained in:
@@ -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]}>
|
||||
|
||||
Reference in New Issue
Block a user