Revert "ensure app session state refreshes on reactivation (#9954)"
This reverts commit 398df1a4b5.
This commit is contained in:
@@ -14,7 +14,6 @@ import {
|
|||||||
useSession,
|
useSession,
|
||||||
useSessionApi,
|
useSessionApi,
|
||||||
} from '#/state/session'
|
} from '#/state/session'
|
||||||
import {agentToSessionAccountOrThrow} from '#/state/session/agent'
|
|
||||||
import {useLoggedOutViewControls} from '#/state/shell/logged-out'
|
import {useLoggedOutViewControls} from '#/state/shell/logged-out'
|
||||||
import {Logo} from '#/view/icons/Logo'
|
import {Logo} from '#/view/icons/Logo'
|
||||||
import {atoms as a, useTheme} from '#/alf'
|
import {atoms as a, useTheme} from '#/alf'
|
||||||
@@ -37,7 +36,7 @@ export function Deactivated() {
|
|||||||
const {onPressSwitchAccount, pendingDid} = useAccountSwitcher()
|
const {onPressSwitchAccount, pendingDid} = useAccountSwitcher()
|
||||||
const {setShowLoggedOut} = useLoggedOutViewControls()
|
const {setShowLoggedOut} = useLoggedOutViewControls()
|
||||||
const hasOtherAccounts = accounts.length > 1
|
const hasOtherAccounts = accounts.length > 1
|
||||||
const {logoutCurrentAccount, resumeSession} = useSessionApi()
|
const {logoutCurrentAccount} = useSessionApi()
|
||||||
const agent = useAgent()
|
const agent = useAgent()
|
||||||
const [pending, setPending] = React.useState(false)
|
const [pending, setPending] = React.useState(false)
|
||||||
const [error, setError] = React.useState<string | undefined>()
|
const [error, setError] = React.useState<string | undefined>()
|
||||||
@@ -73,8 +72,7 @@ export function Deactivated() {
|
|||||||
setPending(true)
|
setPending(true)
|
||||||
await agent.com.atproto.server.activateAccount()
|
await agent.com.atproto.server.activateAccount()
|
||||||
await queryClient.resetQueries()
|
await queryClient.resetQueries()
|
||||||
const account = agentToSessionAccountOrThrow(agent)
|
await agent.resumeSession(agent.session!)
|
||||||
await resumeSession({...account, active: true, status: undefined})
|
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
switch (e.message) {
|
switch (e.message) {
|
||||||
case 'Bad token scope':
|
case 'Bad token scope':
|
||||||
@@ -95,7 +93,7 @@ export function Deactivated() {
|
|||||||
} finally {
|
} finally {
|
||||||
setPending(false)
|
setPending(false)
|
||||||
}
|
}
|
||||||
}, [_, agent, queryClient, resumeSession])
|
}, [_, agent, setPending, setError, queryClient])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={[a.util_screen_outer, a.flex_1]}>
|
<View style={[a.util_screen_outer, a.flex_1]}>
|
||||||
|
|||||||
Reference in New Issue
Block a user