mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-13 10:42:55 +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 () {
|
$('#tabby_json_schema').on('input', function () {
|
||||||
const json_schema_string = $(this).val();
|
const json_schema_string = String($(this).val());
|
||||||
|
|
||||||
// Ignore errors from here
|
|
||||||
try {
|
try {
|
||||||
settings.json_schema = JSON.parse(json_schema_string ?? '{}');
|
settings.json_schema = JSON.parse(json_schema_string ?? '{}');
|
||||||
} catch {}
|
} catch {
|
||||||
|
// Ignore errors from here
|
||||||
|
}
|
||||||
saveSettingsDebounced();
|
saveSettingsDebounced();
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -770,8 +771,8 @@ function setSettingByName(setting, value, trigger) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ('json_schema' === setting) {
|
if ('json_schema' === setting) {
|
||||||
settings.json_schema = value ?? {}
|
settings.json_schema = value ?? {};
|
||||||
$('#tabby_json_schema').text(JSON.stringify(settings.json_schema, null, 2))
|
$('#tabby_json_schema').val(JSON.stringify(settings.json_schema, null, 2));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user