1
0
mirror of https://github.com/SillyTavern/SillyTavern.git synced 2025-02-28 01:47:42 +01:00

Don't reassign thisPromptBits

Instead, just use additionalPromptStuff where thisPromptBits was used
after the assignment.
This commit is contained in:
valadaptive 2024-04-25 08:42:33 -04:00
parent ff9345a843
commit 80a6406062

@ -4016,16 +4016,14 @@ async function Generate(type, { automatic_trigger, force_name2, quiet_prompt, qu
userPersona: (power_user.persona_description || ''),
};
thisPromptBits = additionalPromptStuff;
//console.log(thisPromptBits);
const itemizedIndex = itemizedPrompts.findIndex((item) => item.mesId === thisPromptBits['mesId']);
//console.log(additionalPromptStuff);
const itemizedIndex = itemizedPrompts.findIndex((item) => item.mesId === additionalPromptStuff.mesId);
if (itemizedIndex !== -1) {
itemizedPrompts[itemizedIndex] = thisPromptBits;
itemizedPrompts[itemizedIndex] = additionalPromptStuff;
}
else {
itemizedPrompts.push(thisPromptBits);
itemizedPrompts.push(additionalPromptStuff);
}
console.debug(`pushed prompt bits to itemizedPrompts array. Length is now: ${itemizedPrompts.length}`);