mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-16 11:57:51 +01:00
refac/fix
This commit is contained in:
@@ -124,20 +124,24 @@
|
||||
return null;
|
||||
}
|
||||
|
||||
const res = await updateConfig(localStorage.token, config).catch((error) => {
|
||||
const res = await updateConfig(localStorage.token, {
|
||||
...config,
|
||||
AUTOMATIC1111_PARAMS:
|
||||
typeof config.AUTOMATIC1111_PARAMS === 'string' && config.AUTOMATIC1111_PARAMS.trim() !== ''
|
||||
? JSON.parse(config.AUTOMATIC1111_PARAMS)
|
||||
: {}
|
||||
}).catch((error) => {
|
||||
toast.error(`${error}`);
|
||||
return null;
|
||||
});
|
||||
|
||||
if (res) {
|
||||
config = res;
|
||||
|
||||
if (config.ENABLE_IMAGE_GENERATION) {
|
||||
if (res.ENABLE_IMAGE_GENERATION) {
|
||||
backendConfig.set(await getBackendConfig());
|
||||
getModels();
|
||||
}
|
||||
|
||||
return config;
|
||||
return res;
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -245,6 +249,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
config.AUTOMATIC1111_PARAMS =
|
||||
typeof config.AUTOMATIC1111_PARAMS === 'object'
|
||||
? JSON.stringify(config.AUTOMATIC1111_PARAMS ?? {}, null, 2)
|
||||
: config.AUTOMATIC1111_PARAMS;
|
||||
|
||||
REQUIRED_EDIT_WORKFLOW_NODES = REQUIRED_EDIT_WORKFLOW_NODES.map((node) => {
|
||||
const n =
|
||||
config.IMAGES_EDIT_COMFYUI_WORKFLOW_NODES.find((n) => n.type === node.type) ?? node;
|
||||
|
||||
Reference in New Issue
Block a user