Basic settings screen

This commit is contained in:
space-nuko
2023-05-28 18:41:54 -05:00
parent 4d8390115d
commit e411d29f09
16 changed files with 659 additions and 1915 deletions

View File

@@ -261,17 +261,18 @@ export default class ComfyApp {
return Promise.resolve();
}
/*
* TODO
*/
async loadConfig() {
try {
const config = await fetch(`/config.json`, { cache: "no-store" });
const newConfig = await config.json() as ConfigState;
configState.set({ ...get(configState), ...newConfig });
console.log("Loading config.json...")
const config = localStorage.getItem("config")
if (config == null)
configState.loadDefault();
else
configState.load(JSON.parse(config));
}
catch (error) {
console.error(`Failed to load config`, error)
console.error(`Failed to load config, falling back to defaults`, error)
configState.loadDefault();
}
}