TC: Fix being unable to restore null JSON schema

This commit is contained in:
Cohee
2025-11-23 23:17:03 +02:00
parent 236a3b1c2d
commit ac7076c832
+6 -6
View File
@@ -1152,6 +1152,12 @@ function setSettingByName(setting, value, trigger) {
return;
}
if ('json_schema' === setting) {
settings.json_schema = value ?? null;
$('#tabby_json_schema').val(value ? JSON.stringify(settings.json_schema, null, 2) : '');
return;
}
if (value === null || value === undefined) {
return;
}
@@ -1192,12 +1198,6 @@ function setSettingByName(setting, value, trigger) {
return;
}
if ('json_schema' === setting) {
settings.json_schema = value ?? null;
$('#tabby_json_schema').val(value ? JSON.stringify(settings.json_schema, null, 2) : '');
return;
}
const isCheckbox = $(`#${setting}_textgenerationwebui`).attr('type') == 'checkbox';
const isText = $(`#${setting}_textgenerationwebui`).attr('type') == 'text' || $(`#${setting}_textgenerationwebui`).is('textarea');
if (isCheckbox) {