mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
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:
@@ -311,8 +311,7 @@ const toggleRandomize = (event, inputElement, optionalSelectElement = null) => {
|
|||||||
optionalSelectElement.disabled = true;
|
optionalSelectElement.disabled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
updateGameSetting(active ? inputElement : randomButton);
|
||||||
updateGameSetting(randomButton);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const updateBaseSetting = (event) => {
|
const updateBaseSetting = (event) => {
|
||||||
@@ -324,7 +323,6 @@ const updateBaseSetting = (event) => {
|
|||||||
|
|
||||||
const updateGameSetting = (settingElement) => {
|
const updateGameSetting = (settingElement) => {
|
||||||
const options = JSON.parse(localStorage.getItem(gameName));
|
const options = JSON.parse(localStorage.getItem(gameName));
|
||||||
|
|
||||||
if (settingElement.classList.contains('randomize-button')) {
|
if (settingElement.classList.contains('randomize-button')) {
|
||||||
// If the event passed in is the randomize button, then we know what we must do.
|
// If the event passed in is the randomize button, then we know what we must do.
|
||||||
options[gameName][settingElement.getAttribute('data-key')] = 'random';
|
options[gameName][settingElement.getAttribute('data-key')] = 'random';
|
||||||
|
Reference in New Issue
Block a user