about summary refs log tree commit diff
path: root/src/state/session/types.ts
diff options
context:
space:
mode:
authordan <dan.abramov@gmail.com>2024-05-08 03:10:03 +0100
committerGitHub <noreply@github.com>2024-05-08 03:10:03 +0100
commit0c41b3188a4f4ffc701b980d98e3e7560ee2bc7b (patch)
tree1e3b1133f743de7e9272ef0be007989b8565294b /src/state/session/types.ts
parent31a8356aef278414d4e70985ddbf3f76e6a455f1 (diff)
downloadvoidsky-0c41b3188a4f4ffc701b980d98e3e7560ee2bc7b.tar.zst
[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 <git@esb.lol>
Diffstat (limited to 'src/state/session/types.ts')
-rw-r--r--src/state/session/types.ts9
1 files changed, 1 insertions, 8 deletions
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<void>
-  /**
-   * 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<void>
   removeAccount: (account: SessionAccount) => void
   updateCurrentAccount: (