TC: Fix being unable to restore null JSON schema
| @@ -1152,6 +1152,12 @@ function setSettingByName(setting, value, trigger) { | ||
| 1152 | 1152 | return; |
| 1153 | 1153 | } |
| 1154 | 1154 | |
| 1155 | + if ('json_schema' === setting) { | |
| 1156 | + settings.json_schema = value ?? null; | |
| 1157 | + $('#tabby_json_schema').val(value ? JSON.stringify(settings.json_schema, null, 2) : ''); | |
| 1158 | + return; | |
| 1159 | + } | |
| 1160 | + | |
| 1155 | 1161 | if (value === null || value === undefined) { |
| 1156 | 1162 | return; |
| 1157 | 1163 | } |
| @@ -1192,12 +1198,6 @@ function setSettingByName(setting, value, trigger) { | ||
| 1192 | 1198 | return; |
| 1193 | 1199 | } |
| 1194 | 1200 | |
| 1195 | - if ('json_schema' === setting) { | |
| 1196 | - settings.json_schema = value ?? null; | |
| 1197 | - $('#tabby_json_schema').val(value ? JSON.stringify(settings.json_schema, null, 2) : ''); | |
| 1198 | - return; | |
| 1199 | - } | |
| 1200 | - | |
| 1201 | 1201 | const isCheckbox = $(`#${setting}_textgenerationwebui`).attr('type') == 'checkbox'; |
| 1202 | 1202 | const isText = $(`#${setting}_textgenerationwebui`).attr('type') == 'text' || $(`#${setting}_textgenerationwebui`).is('textarea'); |
| 1203 | 1203 | if (isCheckbox) { |