mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-09 08:38:53 +01:00
Fix schema not loading from presets. Fix ESLint warnings
This commit is contained in:
parent
5210db5679
commit
0b76e1d350
@ -565,12 +565,13 @@ jQuery(function () {
|
||||
});
|
||||
|
||||
$('#tabby_json_schema').on('input', function () {
|
||||
const json_schema_string = $(this).val();
|
||||
const json_schema_string = String($(this).val());
|
||||
|
||||
// Ignore errors from here
|
||||
try {
|
||||
settings.json_schema = JSON.parse(json_schema_string ?? '{}');
|
||||
} catch {}
|
||||
} catch {
|
||||
// Ignore errors from here
|
||||
}
|
||||
saveSettingsDebounced();
|
||||
});
|
||||
|
||||
@ -770,8 +771,8 @@ function setSettingByName(setting, value, trigger) {
|
||||
}
|
||||
|
||||
if ('json_schema' === setting) {
|
||||
settings.json_schema = value ?? {}
|
||||
$('#tabby_json_schema').text(JSON.stringify(settings.json_schema, null, 2))
|
||||
settings.json_schema = value ?? {};
|
||||
$('#tabby_json_schema').val(JSON.stringify(settings.json_schema, null, 2));
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user