TC: Fix being unable to restore null JSON schema
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user