diff --git a/src/ts/process/lorebook.ts b/src/ts/process/lorebook.ts index 63cb7bba..63227e57 100644 --- a/src/ts/process/lorebook.ts +++ b/src/ts/process/lorebook.ts @@ -164,7 +164,7 @@ export async function loadLoreBookPrompt(){ export async function importLoreBook(mode:'global'|'local'|'sglobal'){ const selectedID = get(selectedCharID) let db = get(DataBase) - const page = db.characters[selectedID].chatPage + const page = mode === 'sglobal' ? -1 : db.characters[selectedID].chatPage let lore = mode === 'global' ? db.characters[selectedID].globalLore : mode === 'sglobal' ? db.loreBook[db.loreBookPage].data : @@ -225,7 +225,7 @@ export async function exportLoreBook(mode:'global'|'local'|'sglobal'){ try { const selectedID = get(selectedCharID) const db = get(DataBase) - const page = db.characters[selectedID].chatPage + const page = mode === 'sglobal' ? -1 : db.characters[selectedID].chatPage const lore = mode === 'global' ? db.characters[selectedID].globalLore : mode === 'sglobal' ? db.loreBook[db.loreBookPage].data :