From 115a6b666c28b9a1559e8804e674deafb6cc8ca2 Mon Sep 17 00:00:00 2001 From: kindasneaki Date: Wed, 4 Oct 2023 21:53:59 -0600 Subject: [PATCH] Webhost: random button presisted after being inactive (#2248) * update game settings to get the proper attribute * change to ternary operator --- WebHostLib/static/assets/player-settings.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/WebHostLib/static/assets/player-settings.js b/WebHostLib/static/assets/player-settings.js index f75ba9060303..4ebec1adbf89 100644 --- a/WebHostLib/static/assets/player-settings.js +++ b/WebHostLib/static/assets/player-settings.js @@ -311,8 +311,7 @@ const toggleRandomize = (event, inputElement, optionalSelectElement = null) => { optionalSelectElement.disabled = true; } } - - updateGameSetting(randomButton); + updateGameSetting(active ? inputElement : randomButton); }; const updateBaseSetting = (event) => { @@ -324,7 +323,6 @@ const updateBaseSetting = (event) => { const updateGameSetting = (settingElement) => { const options = JSON.parse(localStorage.getItem(gameName)); - if (settingElement.classList.contains('randomize-button')) { // If the event passed in is the randomize button, then we know what we must do. options[gameName][settingElement.getAttribute('data-key')] = 'random';