Webhost: random button presisted after being inactive (#2248)

* update game settings to get the proper attribute

* change to ternary operator
This commit is contained in:
kindasneaki 2023-10-04 21:53:59 -06:00 committed by GitHub
parent 6c4a3959c3
commit 115a6b666c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 3 deletions

View File

@ -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';