From 4aef0363f47bb0ce8177b2124d69db77a08600bb Mon Sep 17 00:00:00 2001 From: kwaroran Date: Thu, 25 May 2023 21:35:41 +0900 Subject: [PATCH] [fix] global lorebook import --- src/ts/process/lorebook.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 :