catch error when loading config_states

and save config_states with indent
This commit is contained in:
w-e-w
2023-08-20 15:36:39 +09:00
parent 9d2299ed0b
commit 36ecff71ae
2 changed files with 8 additions and 5 deletions

View File

@@ -65,7 +65,7 @@ def save_config_state(name):
filename = os.path.join(config_states_dir, f"{timestamp}_{name}.json")
print(f"Saving backup of webui/extension state to {filename}.")
with open(filename, "w", encoding="utf-8") as f:
json.dump(current_config_state, f)
json.dump(current_config_state, f, indent=4)
config_states.list_config_states()
new_value = next(iter(config_states.all_config_states.keys()), "Current")
new_choices = ["Current"] + list(config_states.all_config_states.keys())