From b245311550f1364beb17b6a3e32c4544522d274d Mon Sep 17 00:00:00 2001 From: Sainan Date: Sat, 29 Jun 2024 13:50:53 +0200 Subject: [PATCH] fix(webui): not saving config fields that aren't already in config.json (#427) --- static/webui/script.js | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/static/webui/script.js b/static/webui/script.js index e6eaa7c9..ffabd833 100644 --- a/static/webui/script.js +++ b/static/webui/script.js @@ -676,12 +676,29 @@ function fetchSettings() { ); } +const uiConfigs = [ + "autoCreateAccount", + "skipStoryModeChoice", + "skipTutorial", + "unlockAllScans", + "unlockAllMissions", + "unlockAllQuests", + "completeAllQuests", + "infiniteResources", + "unlockAllShipFeatures", + "unlockAllShipDecorations", + "unlockAllFlavourItems", + "unlockAllSkins", + "universalPolarityEverywhere", + "spoofMasteryRank" +]; + function doChangeSettings() { fetch("/custom/config") .then(response => response.json()) .then(json => { - for (var i in json) { - var x = document.getElementById(`${i}`); + for (const i of uiConfigs) { + var x = document.getElementById(i); if (x != null) { if (x.type == "checkbox") { if (x.checked === true) {