Skip to content

Commit

Permalink
Webhost: random button presisted after being inactive (ArchipelagoMW#…
Browse files Browse the repository at this point in the history
…2248)

* update game settings to get the proper attribute

* change to ternary operator
  • Loading branch information
kindasneaki authored Oct 5, 2023
1 parent 6c4a395 commit 115a6b6
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions WebHostLib/static/assets/player-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,7 @@ const toggleRandomize = (event, inputElement, optionalSelectElement = null) => {
optionalSelectElement.disabled = true;
}
}

updateGameSetting(randomButton);
updateGameSetting(active ? inputElement : randomButton);
};

const updateBaseSetting = (event) => {
Expand All @@ -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';
Expand Down

0 comments on commit 115a6b6

Please sign in to comment.