about summary refs log tree commit diff
path: root/src/state/models/ui/create-account.ts
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2023-08-30 17:55:01 -0700
committerGitHub <noreply@github.com>2023-08-30 17:55:01 -0700
commit04992f14f15bb7227dd1812d3fdb3cda912c2bba (patch)
tree5f7ea9d298ac959aaff9df7b3d604f1bfdea1c66 /src/state/models/ui/create-account.ts
parenta498acab6e9c4722b8abc509529e712755c2b01c (diff)
downloadvoidsky-04992f14f15bb7227dd1812d3fdb3cda912c2bba.tar.zst
Improvements to UI in web logged-out views (#1341)
* Add LoggedOutLayout for desktop/tablet web

* Avoid screen flash in the transition to onboarding

* Fix comment
Diffstat (limited to 'src/state/models/ui/create-account.ts')
-rw-r--r--src/state/models/ui/create-account.ts9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/state/models/ui/create-account.ts b/src/state/models/ui/create-account.ts
index d9d4f51b9..c5d9f6d9b 100644
--- a/src/state/models/ui/create-account.ts
+++ b/src/state/models/ui/create-account.ts
@@ -109,13 +109,8 @@ export class CreateAccountModel {
     this.setError('')
     this.setIsProcessing(true)
 
-    // open the onboarding screens after the session is created
-    const sessionReadySub = this.rootStore.onSessionReady(() => {
-      sessionReadySub.remove()
-      this.rootStore.onboarding.start()
-    })
-
     try {
+      this.rootStore.onboarding.start() // start now to avoid flashing the wrong view
       await this.rootStore.session.createAccount({
         service: this.serviceUrl,
         email: this.email,
@@ -125,7 +120,7 @@ export class CreateAccountModel {
       })
       track('Create Account')
     } catch (e: any) {
-      sessionReadySub.remove()
+      this.rootStore.onboarding.skip() // undo starting the onboard
       let errMsg = e.toString()
       if (e instanceof ComAtprotoServerCreateAccount.InvalidInviteCodeError) {
         errMsg =