diff --git a/web/src/lib/components/forms/create-user-form.svelte b/web/src/lib/components/forms/create-user-form.svelte index 01d5ed5b8e..125bb192eb 100644 --- a/web/src/lib/components/forms/create-user-form.svelte +++ b/web/src/lib/components/forms/create-user-form.svelte @@ -10,6 +10,8 @@ let canCreateUser = false; + let isCreatingUser = false; + $: { if (password !== confirmPassowrd && confirmPassowrd.length > 0) { error = 'Password does not match'; @@ -22,7 +24,9 @@ const dispatch = createEventDispatcher(); async function registerUser(event: SubmitEvent) { - if (canCreateUser) { + if (canCreateUser && !isCreatingUser) { + isCreatingUser = true; + error = ''; const formElement = event.target as HTMLFormElement; @@ -45,9 +49,12 @@ success = 'New user created'; dispatch('user-created'); + + isCreatingUser = false; return; } else { error = 'Error create user account'; + isCreatingUser = false; } } } @@ -120,6 +127,7 @@