From 4e44823b4c2bcc8674bbea42ec82a3abc1f51bcc Mon Sep 17 00:00:00 2001 From: Cohee Date: Thu, 15 Jun 2023 12:26:58 +0300 Subject: [PATCH] Fix off-by-one in prompt itemization --- public/script.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/script.js b/public/script.js index ea61b620a..4738335e3 100644 --- a/public/script.js +++ b/public/script.js @@ -1221,7 +1221,7 @@ function addOneMessage(mes, { type = "normal", insertAfter = null, scroll = true } //shows or hides the Prompt display button - let mesIdToFind = params.mesId; //Number(newMessage.attr('mesId')); + let mesIdToFind = type == 'swipe' ? params.mesId - 1 : params.mesId; //Number(newMessage.attr('mesId')); //if we have itemized messages, and the array isn't null.. if (params.isUser === false && itemizedPrompts.length !== 0 && itemizedPrompts.length !== null) { @@ -2358,7 +2358,7 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject, let additionalPromptStuff = { ...thisPromptBits[currentArrayEntry], rawPrompt: generate_data.prompt, - mesId: type == 'swipe' ? Number(count_view_mes - 1) : Number(count_view_mes + 1), + mesId: type == 'swipe' ? Number(count_view_mes - 1) : Number(count_view_mes), worldInfoBefore: worldInfoBefore, allAnchors: allAnchors, summarizeString: (extension_prompts['1_memory']?.value || ''),