Fixed SD RPG
This commit is contained in:
+18
-3
@@ -1,17 +1,31 @@
|
||||
export let sessionId = localStorage.getItem('chat_session_id') || null;
|
||||
export let currentPersona = localStorage.getItem('persona_id') || 'default';
|
||||
/** Persona bound to the active session (from server, not global preset). */
|
||||
export let currentPersona = 'default';
|
||||
export let sidebarOpen = true;
|
||||
export let rpgEnabled = false;
|
||||
|
||||
const NEW_CHAT_PERSONA_KEY = 'new_chat_persona_id';
|
||||
|
||||
export function toggleSidebar() { sidebarOpen = !sidebarOpen; return sidebarOpen; }
|
||||
|
||||
export function getNewChatDefaultPersona() {
|
||||
return localStorage.getItem(NEW_CHAT_PERSONA_KEY)
|
||||
|| localStorage.getItem('persona_id')
|
||||
|| 'default';
|
||||
}
|
||||
|
||||
export function setNewChatDefaultPersona(id) {
|
||||
const pid = id || 'default';
|
||||
localStorage.setItem(NEW_CHAT_PERSONA_KEY, pid);
|
||||
}
|
||||
|
||||
export function setSessionId(id) {
|
||||
sessionId = id;
|
||||
if (id) localStorage.setItem('chat_session_id', id);
|
||||
}
|
||||
|
||||
export function setCurrentPersona(id) {
|
||||
currentPersona = id;
|
||||
localStorage.setItem('persona_id', id);
|
||||
currentPersona = id || 'default';
|
||||
}
|
||||
|
||||
export function setRpgEnabled(v) { rpgEnabled = !!v; }
|
||||
@@ -25,6 +39,7 @@ export const dom = {
|
||||
headerTitle: document.getElementById('headerTitle'),
|
||||
emptyState: document.getElementById('emptyState'),
|
||||
affinityDisplay: document.getElementById('affinityDisplay'),
|
||||
statsDisplay: document.getElementById('statsDisplay'),
|
||||
rpgBadge: document.getElementById('rpgBadge'),
|
||||
systemBlob: document.getElementById('systemBlob'),
|
||||
systemBlobContent: document.getElementById('systemBlobContent'),
|
||||
|
||||
Reference in New Issue
Block a user