[Session] Remove imperative agent restoration call
Co-authored-by: dan <dan.abramov@gmail.com>
This commit is contained in:
@@ -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`)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user