[WebHost] weighted-settings: Fix a bug in game choice validation
This commit is contained in:
parent
9f5a2d1eb3
commit
9339019308
|
@ -860,10 +860,6 @@ const validateSettings = () => {
|
|||
return;
|
||||
}
|
||||
|
||||
if (Object.keys(settings.game).length === 0) {
|
||||
errorMessage = 'You have not chosen a game to play!';
|
||||
}
|
||||
|
||||
// Remove any disabled options
|
||||
Object.keys(settings[game]).forEach((setting) => {
|
||||
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 (errorMessage) {
|
||||
userMessage.innerText = errorMessage;
|
||||
|
|
Loading…
Reference in New Issue