From 31a145bb65e663e8e90175193d6ac0b5a0dbc974 Mon Sep 17 00:00:00 2001 From: Jacob Pierce Date: Mon, 7 Jul 2025 17:13:13 -0700 Subject: [PATCH] explicitly disallow double-clicking of submit button during registration --- .../contentcuration/frontend/accounts/pages/Create.vue | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/contentcuration/contentcuration/frontend/accounts/pages/Create.vue b/contentcuration/contentcuration/frontend/accounts/pages/Create.vue index e4e28d6d08..d6badbba25 100644 --- a/contentcuration/contentcuration/frontend/accounts/pages/Create.vue +++ b/contentcuration/contentcuration/frontend/accounts/pages/Create.vue @@ -227,6 +227,7 @@ }, data() { return { + submitting: false, valid: true, registrationFailed: false, form: { @@ -448,6 +449,10 @@ return id === uses.OTHER && this.form.uses.includes(id); }, submit() { + if (this.submitting) { + return; + } + this.submitting = true; // We need to check the "acceptedAgreement" here explicitly because it is not a // Vuetify form field and does not trigger the form validation. if (this.$refs.form.validate() && this.acceptedAgreement) { @@ -486,10 +491,12 @@ this.registrationFailed = true; this.valid = false; } + this.submitting = false; }); } else if (this.$refs.top.scrollIntoView) { this.$refs.top.scrollIntoView({ behavior: 'smooth' }); } + this.submitting = false; return Promise.resolve(); }, resetErrors(field) {