about summary refs log tree commit diff
path: root/src/state/models/ui/create-account.ts
diff options
context:
space:
mode:
authorEric Bailey <git@esb.lol>2023-11-10 11:31:36 -0600
committerGitHub <noreply@github.com>2023-11-10 11:31:36 -0600
commit6513055d02c5f8981f38bface3514af3472474d9 (patch)
tree0d687d4ef59b20a0b75d8e42171c6fafd9e0d36c /src/state/models/ui/create-account.ts
parent8d7475c13069f99170b40d696a7371c94020ef46 (diff)
parent436a14eabb4fe2238ff6048f41042433c0e07268 (diff)
downloadvoidsky-6513055d02c5f8981f38bface3514af3472474d9.tar.zst
Merge pull request #1860 from bluesky-social/eric/startup
Web login/signup and shell
Diffstat (limited to 'src/state/models/ui/create-account.ts')
-rw-r--r--src/state/models/ui/create-account.ts11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/state/models/ui/create-account.ts b/src/state/models/ui/create-account.ts
index 39c881db6..6d76784c1 100644
--- a/src/state/models/ui/create-account.ts
+++ b/src/state/models/ui/create-account.ts
@@ -10,6 +10,7 @@ import {getAge} from 'lib/strings/time'
 import {track} from 'lib/analytics/analytics'
 import {logger} from '#/logger'
 import {DispatchContext as OnboardingDispatchContext} from '#/state/shell/onboarding'
+import {ApiContext as SessionApiContext} from '#/state/session'
 
 const DEFAULT_DATE = new Date(Date.now() - 60e3 * 60 * 24 * 365 * 20) // default to 20 years ago
 
@@ -91,7 +92,13 @@ export class CreateAccountModel {
     }
   }
 
-  async submit(onboardingDispatch: OnboardingDispatchContext) {
+  async submit({
+    createAccount,
+    onboardingDispatch,
+  }: {
+    createAccount: SessionApiContext['createAccount']
+    onboardingDispatch: OnboardingDispatchContext
+  }) {
     if (!this.email) {
       this.setStep(2)
       return this.setError('Please enter your email.')
@@ -113,7 +120,7 @@ export class CreateAccountModel {
 
     try {
       onboardingDispatch({type: 'start'}) // start now to avoid flashing the wrong view
-      await this.rootStore.session.createAccount({
+      await createAccount({
         service: this.serviceUrl,
         email: this.email,
         handle: createFullHandle(this.handle, this.userDomain),