Show error in UI when registration fails (#48)

This commit is contained in:
Jess Martin 2022-08-30 16:43:21 -04:00 committed by GitHub
parent eb61c6b5e6
commit d0bfd9a10f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -33,6 +33,8 @@
authInProcess = true authInProcess = true
registrationSuccess = await register(username) registrationSuccess = await register(username)
if (!registrationSuccess) authInProcess = false
} }
</script> </script>

View File

@ -89,6 +89,8 @@ export const isUsernameAvailable = async (
export const register = async (username: string): Promise<boolean> => { export const register = async (username: string): Promise<boolean> => {
const { success } = await webnative.account.register({ username }) const { success } = await webnative.account.register({ username })
if (!success) return success
const fs = await webnative.bootstrapRootFileSystem() const fs = await webnative.bootstrapRootFileSystem()
filesystemStore.set(fs) filesystemStore.set(fs)