Disable the upload button while uploading
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
This commit is contained in:
parent
e1ffeef646
commit
089add1a80
|
@ -151,6 +151,10 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Disable the upload button
|
||||||
|
uploadButton.disabled = true;
|
||||||
|
uploadButton.textContent = 'Uploading...';
|
||||||
|
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
formData.append('file', file);
|
formData.append('file', file);
|
||||||
|
|
||||||
|
@ -173,6 +177,10 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||||
addAIManualMessage('File uploaded and processed!');
|
addAIManualMessage('File uploaded and processed!');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
uploadResultDiv.textContent = 'Error: ' + error.message;
|
uploadResultDiv.textContent = 'Error: ' + error.message;
|
||||||
|
} finally {
|
||||||
|
// Re-enable the upload button
|
||||||
|
uploadButton.disabled = false;
|
||||||
|
uploadButton.textContent = 'Upload';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue