From 56c6955f234520e79f2b5c2ce8a1bf82c094f3f4 Mon Sep 17 00:00:00 2001 From: Wolfsblvt Date: Fri, 5 Jul 2024 20:50:30 +0200 Subject: [PATCH] WI entries with world name obj format - Changed format of WI entry objects for debugging purposes. Moved the world name right after uid, so it looks better in debugger --- public/scripts/world-info.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/scripts/world-info.js b/public/scripts/world-info.js index c618170ea..765ab65e5 100644 --- a/public/scripts/world-info.js +++ b/public/scripts/world-info.js @@ -3445,7 +3445,7 @@ async function getCharacterLore() { } const data = await loadWorldInfoData(worldName); - const newEntries = data ? Object.keys(data.entries).map((x) => data.entries[x]).map(x => ({ ...x, world: worldName })) : []; + const newEntries = data ? Object.keys(data.entries).map((x) => data.entries[x]).map(({ uid, ...rest }) => ({ uid, world: worldName, ...rest })) : []; entries = entries.concat(newEntries); if (!newEntries.length) { @@ -3465,7 +3465,7 @@ async function getGlobalLore() { let entries = []; for (const worldName of selected_world_info) { const data = await loadWorldInfoData(worldName); - const newEntries = data ? Object.keys(data.entries).map((x) => data.entries[x]).map(x => ({ ...x, world: worldName })) : []; + const newEntries = data ? Object.keys(data.entries).map((x) => data.entries[x]).map(({ uid, ...rest }) => ({ uid, world: worldName, ...rest })) : []; entries = entries.concat(newEntries); } @@ -3487,7 +3487,7 @@ async function getChatLore() { } const data = await loadWorldInfoData(chatWorld); - const newEntries = data ? Object.keys(data.entries).map((x) => data.entries[x]).map(x => ({ ...x, world: chatWorld })) : []; + const entries = data ? Object.keys(data.entries).map((x) => data.entries[x]).map(({ uid, ...rest }) => ({ uid, world: chatWorld, ...rest })) : []; console.debug(`[WI] Chat lore has ${entries.length} entries`, [chatWorld]);