From 0c41b3188a4f4ffc701b980d98e3e7560ee2bc7b Mon Sep 17 00:00:00 2001 From: dan Date: Wed, 8 May 2024 03:10:03 +0100 Subject: [Session] Remove global agent (#3852) * Remove logs and outdated comments * Move side effect upwards * Pull refreshedAccount next to usage * Simplify account refresh logic * Extract setupPublicAgentState() * Collapse setStates into one * Ignore events from stale agents * Use agent from state * Remove clearCurrentAccount * Move state to a reducer * Remove global agent * Fix stale agent reference in create flow * Proceed to onboarding even if setting date fails --------- Co-authored-by: Eric Bailey --- src/state/session/types.ts | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'src/state/session/types.ts') diff --git a/src/state/session/types.ts b/src/state/session/types.ts index b3252f777..b9fd31502 100644 --- a/src/state/session/types.ts +++ b/src/state/session/types.ts @@ -14,6 +14,7 @@ export type SessionApiContext = { email: string password: string handle: string + birthDate: Date inviteCode?: string verificationPhone?: string verificationCode?: string @@ -35,14 +36,6 @@ export type SessionApiContext = { logout: ( logContext: LogEvents['account:loggedOut']['logContext'], ) => Promise - /** - * A partial logout. Clears the `currentAccount` from session, but DOES NOT - * clear access tokens from accounts, allowing the user to return to their - * other accounts without logging in. - * - * Used when adding a new account, deleting an account. - */ - clearCurrentAccount: () => void initSession: (account: SessionAccount) => Promise removeAccount: (account: SessionAccount) => void updateCurrentAccount: ( -- cgit 1.4.1