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:
parent
b1e8858de9
commit
85048c9660
|
@ -45,6 +45,9 @@ function initRepoDiffConversationForm() {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
const $form = $(e.target);
|
const $form = $(e.target);
|
||||||
|
if ($form.hasClass('is-loading')) return;
|
||||||
|
$form.addClass('is-loading');
|
||||||
|
|
||||||
const $textArea = $form.find('textarea');
|
const $textArea = $form.find('textarea');
|
||||||
if (!validateTextareaNonEmpty($textArea)) {
|
if (!validateTextareaNonEmpty($textArea)) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue