From 809f40dec938a3e9bdd0a6cf3ec8606ecba3075d Mon Sep 17 00:00:00 2001 From: Restray Date: Fri, 1 Apr 2022 21:41:22 +0200 Subject: [PATCH] feat: add loading on register button --- src/routes/register/index.svelte | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/routes/register/index.svelte b/src/routes/register/index.svelte index 35501fce2..0b2183444 100644 --- a/src/routes/register/index.svelte +++ b/src/routes/register/index.svelte @@ -19,6 +19,9 @@ emailEl.focus(); }); async function handleSubmit() { + // Prevent double submission + if (loading) return; + if (password !== passwordCheck) { return errorNotification('Passwords do not match.'); } @@ -88,8 +91,13 @@ />
- {loading ? 'Registering...' : 'Register'}