Apply expired logic
This commit is contained in:
@@ -274,6 +274,9 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
|
|||||||
createPersistSessionHandler(
|
createPersistSessionHandler(
|
||||||
account,
|
account,
|
||||||
({expired, refreshedAccount}) => {
|
({expired, refreshedAccount}) => {
|
||||||
|
if (expired) {
|
||||||
|
__globalAgent = PUBLIC_BSKY_AGENT
|
||||||
|
}
|
||||||
upsertAccount(refreshedAccount, expired)
|
upsertAccount(refreshedAccount, expired)
|
||||||
},
|
},
|
||||||
{networkErrorCallback: clearCurrentAccount},
|
{networkErrorCallback: clearCurrentAccount},
|
||||||
@@ -319,6 +322,9 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
|
|||||||
createPersistSessionHandler(
|
createPersistSessionHandler(
|
||||||
account,
|
account,
|
||||||
({expired, refreshedAccount}) => {
|
({expired, refreshedAccount}) => {
|
||||||
|
if (expired) {
|
||||||
|
__globalAgent = PUBLIC_BSKY_AGENT
|
||||||
|
}
|
||||||
upsertAccount(refreshedAccount, expired)
|
upsertAccount(refreshedAccount, expired)
|
||||||
},
|
},
|
||||||
{networkErrorCallback: clearCurrentAccount},
|
{networkErrorCallback: clearCurrentAccount},
|
||||||
@@ -364,8 +370,13 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
|
|||||||
persistSession: createPersistSessionHandler(
|
persistSession: createPersistSessionHandler(
|
||||||
account,
|
account,
|
||||||
async ({expired, refreshedAccount}) => {
|
async ({expired, refreshedAccount}) => {
|
||||||
|
if (expired) {
|
||||||
|
__globalAgent = PUBLIC_BSKY_AGENT
|
||||||
|
} else {
|
||||||
__globalAgent = agent
|
__globalAgent = agent
|
||||||
await configureModeration(agent, account)
|
await configureModeration(agent, account)
|
||||||
|
}
|
||||||
|
|
||||||
upsertAccount(refreshedAccount, expired)
|
upsertAccount(refreshedAccount, expired)
|
||||||
},
|
},
|
||||||
{networkErrorCallback: clearCurrentAccount},
|
{networkErrorCallback: clearCurrentAccount},
|
||||||
|
|||||||
Reference in New Issue
Block a user