Apply expired logic

This commit is contained in:
Eric Bailey
2024-04-03 17:29:17 -05:00
parent cd5b555b08
commit 0ba76deb0c
+13 -2
View File
@@ -274,6 +274,9 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
createPersistSessionHandler(
account,
({expired, refreshedAccount}) => {
if (expired) {
__globalAgent = PUBLIC_BSKY_AGENT
}
upsertAccount(refreshedAccount, expired)
},
{networkErrorCallback: clearCurrentAccount},
@@ -319,6 +322,9 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
createPersistSessionHandler(
account,
({expired, refreshedAccount}) => {
if (expired) {
__globalAgent = PUBLIC_BSKY_AGENT
}
upsertAccount(refreshedAccount, expired)
},
{networkErrorCallback: clearCurrentAccount},
@@ -364,8 +370,13 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
persistSession: createPersistSessionHandler(
account,
async ({expired, refreshedAccount}) => {
__globalAgent = agent
await configureModeration(agent, account)
if (expired) {
__globalAgent = PUBLIC_BSKY_AGENT
} else {
__globalAgent = agent
await configureModeration(agent, account)
}
upsertAccount(refreshedAccount, expired)
},
{networkErrorCallback: clearCurrentAccount},