Skip to content

Commit

Permalink
Update startup.js
Browse files Browse the repository at this point in the history
  • Loading branch information
SharkPool-SP authored Jan 2, 2025
1 parent 5d2390f commit f3edf81
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions scripts/startup.js
Original file line number Diff line number Diff line change
Expand Up @@ -451,14 +451,18 @@ document.querySelector("form").addEventListener("submit", async (e) => {
console.log("Submitting Promotion...");
const loadScreen = showLoadingGUI();
const urlData = await constructPost();
fetch(urlData)
const response = await fetch(urlData);
.then((r) => {
alert("Promotion Submitted!");
loadScreen.remove();
})
.catch((e) => {
console.warn("Submission Error", e);
window.test = e;
/* Note:
This is not a fool-proof check, but this is the only one we're able
to do to actually check if this uploaded to the form.
*/
if (e.message === "Failed to fetch") alert("Promotion Submitted!");
else console.warn("Submission Error", e);
loadScreen.remove();
});
}
Expand Down

0 comments on commit f3edf81

Please sign in to comment.