refactor: do it in the construct itself
This commit is contained in:
@@ -369,7 +369,7 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
|
|||||||
async account => {
|
async account => {
|
||||||
logger.debug(`session: initSession`, {}, logger.DebugContext.session)
|
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(
|
agent.setPersistSessionHandler(
|
||||||
createPersistSessionHandler(
|
createPersistSessionHandler(
|
||||||
@@ -410,10 +410,6 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
|
|||||||
isSessionDeactivated(account.accessJwt) || account.deactivated,
|
isSessionDeactivated(account.accessJwt) || account.deactivated,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (account.pdsUrl) {
|
|
||||||
agent.api.xrpc.uri = agent.pdsUrl = new URL(account.pdsUrl)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (canReusePrevSession) {
|
if (canReusePrevSession) {
|
||||||
logger.debug(`session: attempting to reuse previous session`)
|
logger.debug(`session: attempting to reuse previous session`)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user