[Session] Remove imperative agent restoration call

Co-authored-by: dan <dan.abramov@gmail.com>
This commit is contained in:
Eric Bailey
2024-05-03 04:16:51 +01:00
committed by Dan Abramov
parent cdf7a1957a
commit 6e9320163a
-13
View File
@@ -332,7 +332,6 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
if (isSessionExpired(account)) {
logger.debug(`session: attempting to resume using previous session`)
try {
const freshAccount = await resumeSessionWithFreshAccount()
__globalAgent = agent
await fetchingGates
@@ -349,18 +348,6 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
needsPersist: true,
}
})
} catch (e) {
/*
* Note: `agent.persistSession` is also called when this fails, and
* we handle that failure via `createPersistSessionHandler`
*/
logger.info(`session: resumeSessionWithFreshAccount failed`, {
message: e,
})
__globalAgent = PUBLIC_BSKY_AGENT
// TODO: This needs a setState.
}
} else {
logger.debug(`session: attempting to reuse previous session`)