From ab878ba9a6afaa57805aeab988b01c5b47bc9286 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Thu, 9 Nov 2023 20:35:17 -0600 Subject: Web login/signup and shell --- src/state/models/ui/create-account.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/state/models/ui/create-account.ts') 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), -- cgit 1.4.1