From 9339019308cd603b47e2802ae307ff87bc24af4b Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 11 Jan 2022 02:26:11 -0500 Subject: [PATCH] [WebHost] weighted-settings: Fix a bug in game choice validation --- WebHostLib/static/assets/weighted-settings.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/WebHostLib/static/assets/weighted-settings.js b/WebHostLib/static/assets/weighted-settings.js index a89a003f..15a6f1db 100644 --- a/WebHostLib/static/assets/weighted-settings.js +++ b/WebHostLib/static/assets/weighted-settings.js @@ -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;