Merge pull request #19 from ZXMushroom63/main

Fix bug where mod is added even though cancel is pressed
This commit is contained in:
Oliver Anderson 2024-05-05 09:48:22 -06:00 committed by GitHub
commit a250f3c00a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

@ -112,6 +112,9 @@ function displayGui() {
addBtn.innerHTML = "Add new"; addBtn.innerHTML = "Add new";
addBtn.addEventListener("click", () => { addBtn.addEventListener("click", () => {
var newMod = window.prompt("URL of Mod: ", "http://example.com/example.js"); var newMod = window.prompt("URL of Mod: ", "http://example.com/example.js");
if (!newMod) {
return; //User pressed cancel
}
Mods.push( Mods.push(
newMod newMod
); );