Don't insert a newline on empty WI

This commit is contained in:
Cohee
2023-07-03 11:34:15 +03:00
parent d566be077d
commit 13deac2527

View File

@@ -1015,8 +1015,8 @@ async function checkWorldInfo(chat, maxContext) {
}
});
const worldInfoBefore = `${WIBeforeEntries.join("\n")}\n`
const worldInfoAfter = `${WIAfterEntries.join("\n")}\n`
const worldInfoBefore = WIBeforeEntries.length ? `${WIBeforeEntries.join("\n")}\n` : '';
const worldInfoAfter = WIAfterEntries.length ? `${WIAfterEntries.join("\n")}\n` : '';
if (shouldWIAddPrompt) {
const originalAN = context.extensionPrompts[NOTE_MODULE_NAME].value;