forked from OpenWF/SpaceNinjaServer
		
	fix(webui): not saving config fields that aren't already in config.json (#427)
This commit is contained in:
		
							parent
							
								
									4e03b7b92e
								
							
						
					
					
						commit
						b245311550
					
				@ -676,12 +676,29 @@ function fetchSettings() {
 | 
				
			|||||||
        );
 | 
					        );
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const uiConfigs = [
 | 
				
			||||||
 | 
					    "autoCreateAccount",
 | 
				
			||||||
 | 
					    "skipStoryModeChoice",
 | 
				
			||||||
 | 
					    "skipTutorial",
 | 
				
			||||||
 | 
					    "unlockAllScans",
 | 
				
			||||||
 | 
					    "unlockAllMissions",
 | 
				
			||||||
 | 
					    "unlockAllQuests",
 | 
				
			||||||
 | 
					    "completeAllQuests",
 | 
				
			||||||
 | 
					    "infiniteResources",
 | 
				
			||||||
 | 
					    "unlockAllShipFeatures",
 | 
				
			||||||
 | 
					    "unlockAllShipDecorations",
 | 
				
			||||||
 | 
					    "unlockAllFlavourItems",
 | 
				
			||||||
 | 
					    "unlockAllSkins",
 | 
				
			||||||
 | 
					    "universalPolarityEverywhere",
 | 
				
			||||||
 | 
					    "spoofMasteryRank"
 | 
				
			||||||
 | 
					];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function doChangeSettings() {
 | 
					function doChangeSettings() {
 | 
				
			||||||
    fetch("/custom/config")
 | 
					    fetch("/custom/config")
 | 
				
			||||||
        .then(response => response.json())
 | 
					        .then(response => response.json())
 | 
				
			||||||
        .then(json => {
 | 
					        .then(json => {
 | 
				
			||||||
            for (var i in json) {
 | 
					            for (const i of uiConfigs) {
 | 
				
			||||||
                var x = document.getElementById(`${i}`);
 | 
					                var x = document.getElementById(i);
 | 
				
			||||||
                if (x != null) {
 | 
					                if (x != null) {
 | 
				
			||||||
                    if (x.type == "checkbox") {
 | 
					                    if (x.type == "checkbox") {
 | 
				
			||||||
                        if (x.checked === true) {
 | 
					                        if (x.checked === true) {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user