[WebHost] weighted-settings: Fix a bug in game choice validation

This commit is contained in:
Chris Wilson 2022-01-11 02:26:11 -05:00
parent 9f5a2d1eb3
commit 9339019308
1 changed files with 4 additions and 4 deletions

View File

@ -860,10 +860,6 @@ const validateSettings = () => {
return; return;
} }
if (Object.keys(settings.game).length === 0) {
errorMessage = 'You have not chosen a game to play!';
}
// Remove any disabled options // Remove any disabled options
Object.keys(settings[game]).forEach((setting) => { Object.keys(settings[game]).forEach((setting) => {
Object.keys(settings[game][setting]).forEach((option) => { Object.keys(settings[game][setting]).forEach((option) => {
@ -878,6 +874,10 @@ const validateSettings = () => {
}); });
}); });
if (Object.keys(settings.game).length === 0) {
errorMessage = 'You have not chosen a game to play!';
}
// If an error occurred, alert the user and do not export the file // If an error occurred, alert the user and do not export the file
if (errorMessage) { if (errorMessage) {
userMessage.innerText = errorMessage; userMessage.innerText = errorMessage;