mirror of
1
Fork 0

Prevent multiple codecomments to be submitted

- Utilize the existing `is-loading` class to prevent the submit code
from running twice or more.
- The `is-loading` class gives us a nice loading indicator when added to
the form.
- Resolves https://codeberg.org/forgejo/forgejo/issues/1476
This commit is contained in:
Gusted 2023-11-11 10:36:04 +01:00
parent b1e8858de9
commit 85048c9660
No known key found for this signature in database
GPG Key ID: FD821B732837125F
1 changed files with 3 additions and 0 deletions

View File

@ -45,6 +45,9 @@ function initRepoDiffConversationForm() {
e.preventDefault();
const $form = $(e.target);
if ($form.hasClass('is-loading')) return;
$form.addClass('is-loading');
const $textArea = $form.find('textarea');
if (!validateTextareaNonEmpty($textArea)) {
return;