mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-22 21:50:42 -05:00
fix: switching an optional valve to Custom in the chat controls shows an error (#34478)
* fix: switching an optional valve to Custom in the chat controls shows an error Switching an optional valve, such as an optional on/off setting, from Default to Custom in the Valves section of the chat controls saved the still empty box right away, and the server refused it with "Error updating function user valves". Emptying the box later failed the same way. Switching to Custom now saves once something is entered, and an emptied optional on/off or number valve goes back to its default; optional text valves still save an empty text. Fixes #34475 * Drop a comment that restates its condition * Name schema entries the way the schema helpers do
This commit is contained in:
1 parent
5ddd419539
commit
958edefcac
2 files changed
+8
-1
No files matched your search
@@ -94,6 +94,11 @@
|
||||
} else if (valves[property] == null) {
|
||||
valves[property] = null;
|
||||
}
|
||||
} else if (valves[property] === '') {
|
||||
const types = (valvesSpec.properties[property]?.anyOf ?? []).map((inner) => inner.type);
|
||||
if (types.includes('null') && !types.includes('string')) {
|
||||
valves[property] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,9 @@
|
||||
valves[property] = null;
|
||||
}
|
||||
|
||||
dispatch('change');
|
||||
if (valves[property] !== '') {
|
||||
dispatch('change');
|
||||
}
|
||||
}}
|
||||
>
|
||||
{#if (valves[property] ?? null) === null}
|
||||
|
||||
Reference in new issue
Block a user