Skip to content

Commit

Permalink
Ensure at least one loader is checked (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
cassiancc authored Dec 6, 2024
1 parent 2e7da51 commit 671055c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions res/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ function refreshFabricLikeCheckbox() {
fabricLikeInput.disabled = !hasFabricLike;
}

function isLoaderChecked() {
return document.getElementById("fabric-loader-input").checked || document.getElementById("forge-loader-input").checked || document.getElementById("neoforge-loader-input").checked || document.getElementById("quilt-loader-input").checked
}

document.getElementById("generate-button").onclick = async () => {
updateState();

Expand All @@ -186,6 +190,9 @@ document.getElementById("generate-button").onclick = async () => {
} else if (state.package_name === "") {
showError("Package name is empty");
return;
} else if (!isLoaderChecked()) {
showError("You need to choose at least one subproject first!")
return
}

clearError();
Expand Down

0 comments on commit 671055c

Please sign in to comment.