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

View File

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