Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webhost: random button presisted after being inactive #2248

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}
}

kindasneaki marked this conversation as resolved.
Show resolved Hide resolved
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