Set background client-side

This commit is contained in:
valadaptive
2023-12-15 05:43:27 -05:00
parent 7897206cf8
commit 0ee19d2ede
10 changed files with 64 additions and 55 deletions

View File

@ -187,7 +187,7 @@ import {
import { applyLocale, initLocales } from './scripts/i18n.js';
import { getFriendlyTokenizerName, getTokenCount, getTokenizerModel, initTokenizers, saveTokenCache } from './scripts/tokenizers.js';
import { createPersona, initPersonas, selectCurrentPersona, setPersonaDescription } from './scripts/personas.js';
import { getBackgrounds, initBackgrounds } from './scripts/backgrounds.js';
import { getBackgrounds, initBackgrounds, loadBackgroundSettings, background_settings } from './scripts/backgrounds.js';
import { hideLoader, showLoader } from './scripts/loader.js';
import { BulkEditOverlay, CharacterContextMenu } from './scripts/BulkEditOverlay.js';
import { loadMancerModels } from './scripts/mancer-settings.js';
@ -5674,6 +5674,9 @@ async function getSettings() {
// Load character tags
loadTagsSettings(settings);
// Load background
loadBackgroundSettings(settings);
// Allow subscribers to mutate settings
eventSource.emit(event_types.SETTINGS_LOADED_AFTER, settings);
@ -5756,6 +5759,9 @@ async function saveSettings(type) {
console.warn('Settings not ready, aborting save');
return;
}
console.log(background_settings);
//console.log('Entering settings with name1 = '+name1);
return jQuery.ajax({
@ -5785,6 +5791,7 @@ async function saveSettings(type) {
nai_settings: nai_settings,
kai_settings: kai_settings,
oai_settings: oai_settings,
background: background_settings,
}, null, 4),
beforeSend: function () { },
cache: false,