mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-06-06 18:30:57 +00:00
Fix file clear for errors (#2302)
* Prevent file input from being removed when an error occurs * Fix a bug preventing fetch when 'Bored waiting' btn isn't present
This commit is contained in:
parent
61bccd1d8b
commit
543ad083a2
@ -39,7 +39,9 @@
|
|||||||
const originalButtonText = submitButton.textContent;
|
const originalButtonText = submitButton.textContent;
|
||||||
var boredWaiting = localStorage.getItem("boredWaiting") || "disabled";
|
var boredWaiting = localStorage.getItem("boredWaiting") || "disabled";
|
||||||
|
|
||||||
showGameBtn.style.display = "none";
|
if (showGameBtn) {
|
||||||
|
showGameBtn.style.display = "none";
|
||||||
|
}
|
||||||
|
|
||||||
// Remove empty file entries
|
// Remove empty file entries
|
||||||
for (let [key, value] of formData.entries()) {
|
for (let [key, value] of formData.entries()) {
|
||||||
@ -73,8 +75,10 @@
|
|||||||
|
|
||||||
clearFileInput();
|
clearFileInput();
|
||||||
clearTimeout(timeoutId);
|
clearTimeout(timeoutId);
|
||||||
showGameBtn.style.display = "none";
|
if (showGameBtn) {
|
||||||
showGameBtn.style.marginTop = "";
|
showGameBtn.style.display = "none";
|
||||||
|
showGameBtn.style.marginTop = "";
|
||||||
|
}
|
||||||
submitButton.textContent = originalButtonText;
|
submitButton.textContent = originalButtonText;
|
||||||
submitButton.disabled = false;
|
submitButton.disabled = false;
|
||||||
|
|
||||||
@ -95,7 +99,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
clearFileInput();
|
|
||||||
clearTimeout(timeoutId);
|
clearTimeout(timeoutId);
|
||||||
showGameBtn.style.display = "none";
|
showGameBtn.style.display = "none";
|
||||||
submitButton.textContent = originalButtonText;
|
submitButton.textContent = originalButtonText;
|
||||||
@ -158,7 +161,6 @@
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
success = false;
|
success = false;
|
||||||
errorMessage = error.message;
|
errorMessage = error.message;
|
||||||
clearFileInput();
|
|
||||||
console.error("Error in handleSingleDownload:", error);
|
console.error("Error in handleSingleDownload:", error);
|
||||||
throw error;
|
throw error;
|
||||||
} finally {
|
} finally {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user