Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@
},
data() {
return {
submitting: false,
valid: true,
registrationFailed: false,
form: {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Comment on lines +494 to +499
Copy link

Copilot AI Jul 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resetting submitting immediately after dispatch call (outside of its promise handlers) allows the button to re-enable before the request completes. Move this reset into a finally block on the dispatch promise or remove this unconditional reset so the flag only clears after success or failure.

Suggested change
this.submitting = false;
});
} else if (this.$refs.top.scrollIntoView) {
this.$refs.top.scrollIntoView({ behavior: 'smooth' });
}
this.submitting = false;
})
.finally(() => {
this.submitting = false;
});
} else if (this.$refs.top.scrollIntoView) {
this.$refs.top.scrollIntoView({ behavior: 'smooth' });
}

Copilot uses AI. Check for mistakes.
return Promise.resolve();
Copy link

Copilot AI Jul 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Returning Promise.resolve() prevents callers from awaiting the actual registration request. Instead, return the this.$store.dispatch(...) promise (chained with .finally(...)) so consumers can rely on the real submission lifecycle.

Suggested change
return Promise.resolve();
return Promise.reject(new Error('Validation failed or agreement not accepted'));

Copilot uses AI. Check for mistakes.
},
resetErrors(field) {
Expand Down