[🙅] Integrate deactivate (#4308)
* Update types (cherry picked from commit 27deac1f367825771ba76fa098ec1b0a62dcf64a) * Integrate into deactivate dialog (cherry picked from commit 84f299a447259cc1fbfc7be607e28197779e4ec1) * Integrate into Deactivated screen (cherry picked from commit 29193f34822ecdf11e2a407197fa230285dfe846) * Bump api sdk (cherry picked from commit 738c622d3e5a23bfbb0d3bdce3a6bdf01e54ca60) * Update permalink (cherry picked from commit c10bf5c071d76c3054bc4ce9d313c10b1820f038) * Bump sdk pkg * Update types to match backend * Loosen types for forwards compat * Hydrate status from persisted data * Refresh session when re-activating, clear query cache * Show app password error * Refactor dialog to clear state when closed * Add app password error to Deactivated screen
This commit is contained in:
parent
e64b7cf698
commit
3ece21cb45
7 changed files with 216 additions and 20 deletions
|
|
@ -46,6 +46,11 @@ export async function createAgentAndResume(
|
|||
emailConfirmed: storedAccount.emailConfirmed,
|
||||
handle: storedAccount.handle,
|
||||
refreshJwt: storedAccount.refreshJwt ?? '',
|
||||
/**
|
||||
* @see https://github.com/bluesky-social/atproto/blob/c5d36d5ba2a2c2a5c4f366a5621c06a5608e361e/packages/api/src/agent.ts#L188
|
||||
*/
|
||||
active: storedAccount.active ?? true,
|
||||
status: storedAccount.status,
|
||||
}
|
||||
if (isSessionExpired(storedAccount)) {
|
||||
await networkRetry(1, () => agent.resumeSession(prevSession))
|
||||
|
|
@ -235,8 +240,8 @@ export function agentToSessionAccount(
|
|||
refreshJwt: agent.session.refreshJwt,
|
||||
accessJwt: agent.session.accessJwt,
|
||||
signupQueued: isSignupQueued(agent.session.accessJwt),
|
||||
// @ts-expect-error TODO remove when backend is ready
|
||||
status: agent.session.status,
|
||||
active: agent.session.active,
|
||||
status: agent.session.status as SessionAccount['status'],
|
||||
pdsUrl: agent.pdsUrl?.toString(),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue