Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

feat: add loading on register button

Restray809f40dec938
diff --git a/src/routes/register/index.svelte b/src/routes/register/index.svelte
index 35501fce20..0b2183444f 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 @@
/>
<div class="flex space-x-2 h-8 items-center justify-center pt-8">
- <button type="submit" class="hover:bg-coollabs-100 text-white bg-coollabs"
- >Register</button
+ <button
+ type="submit"
+ class="hover:bg-coollabs-100 text-white"
+ disabled={loading}
+ class:bg-transparent={loading}
+ class:text-stone-600={loading}
+ class:bg-coollabs={!loading}>{loading ? 'Registering...' : 'Register'}</button
>
</div>
</form>