From ac7076c832c9500accfe874ef8ace72617536b6f Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Sun, 23 Nov 2025 23:17:03 +0200 Subject: [PATCH] TC: Fix being unable to restore null JSON schema --- public/scripts/textgen-settings.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/public/scripts/textgen-settings.js b/public/scripts/textgen-settings.js index ad2294bb5..ec10cdd97 100644 --- a/public/scripts/textgen-settings.js +++ b/public/scripts/textgen-settings.js @@ -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) {