refactor: do it in the construct itself

This commit is contained in:
Mary
2024-04-19 21:37:28 +07:00
parent 31ca451464
commit ce96223264
+1 -5
View File
@@ -369,7 +369,7 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
async account => {
logger.debug(`session: initSession`, {}, logger.DebugContext.session)
const agent = new BskyAgent({service: account.service})
const agent = new BskyAgent({service: account.pdsUrl || account.service})
agent.setPersistSessionHandler(
createPersistSessionHandler(
@@ -410,10 +410,6 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
isSessionDeactivated(account.accessJwt) || account.deactivated,
}
if (account.pdsUrl) {
agent.api.xrpc.uri = agent.pdsUrl = new URL(account.pdsUrl)
}
if (canReusePrevSession) {
logger.debug(`session: attempting to reuse previous session`)