From d0bfd9a10f709ae2b2e8e36ed0ab2fafdb90700f Mon Sep 17 00:00:00 2001 From: Jess Martin Date: Tue, 30 Aug 2022 16:43:21 -0400 Subject: [PATCH] Show error in UI when registration fails (#48) --- src/components/auth/register/Register.svelte | 2 ++ src/lib/common/webnative.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/components/auth/register/Register.svelte b/src/components/auth/register/Register.svelte index 7449b09..8c8e79e 100644 --- a/src/components/auth/register/Register.svelte +++ b/src/components/auth/register/Register.svelte @@ -33,6 +33,8 @@ authInProcess = true registrationSuccess = await register(username) + + if (!registrationSuccess) authInProcess = false } diff --git a/src/lib/common/webnative.ts b/src/lib/common/webnative.ts index 2302cad..3c403c7 100644 --- a/src/lib/common/webnative.ts +++ b/src/lib/common/webnative.ts @@ -89,6 +89,8 @@ export const isUsernameAvailable = async ( export const register = async (username: string): Promise => { const { success } = await webnative.account.register({ username }) + if (!success) return success + const fs = await webnative.bootstrapRootFileSystem() filesystemStore.set(fs)