mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-14 05:01:13 +00:00
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
1 changed files with 3 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue