Skip to content

Commit

Permalink
Disable submit button while processing
Browse files Browse the repository at this point in the history
  • Loading branch information
personalizedrefrigerator committed Nov 25, 2023
1 parent 7ca0ab2 commit f4dcbbf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/server/public/js/index/sync_debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ const setUpItemChecker = (parent, onSubmit) => {
outputContainer.classList.remove('error');
outputContainer.classList.remove('empty');
outputContainer.classList.add('loading');
button.disabled = true;

try {
await onSubmit(itemLinkToId(input.value), outputHeading, outputDetailsContent);
Expand All @@ -60,6 +61,8 @@ const setUpItemChecker = (parent, onSubmit) => {
outputHeading.innerText = `⚠️ Error: ${error}`;
outputContainer.classList.add('error');
}

button.disabled = false;
};

parent.appendChild(button);
Expand Down

0 comments on commit f4dcbbf

Please sign in to comment.