Fix cfgMessage handling

d2cc8b36b8c2f2e3d81b3c76a852250d37a52615

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +6 -3Ignore whitespace
public/script.js+6 -3
@@ -4467,10 +4467,13 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
4467 // TODO: Make all extension prompts use an array/splice method4467 // TODO: Make all extension prompts use an array/splice method
4468 const lengthDiff = mesSend.length - cfgPrompt.depth;4468 const lengthDiff = mesSend.length - cfgPrompt.depth;
4469 const cfgDepth = lengthDiff >= 0 ? lengthDiff : 0;4469 const cfgDepth = lengthDiff >= 0 ? lengthDiff : 0;
4470 if (!Array.isArray(finalMesSend[cfgDepth].extensionPrompts)) {4470 const cfgMessage = finalMesSend[cfgDepth];
4471 finalMesSend[cfgDepth].extensionPrompts = [];4471 if (cfgMessage) {
4472 if (!Array.isArray(finalMesSend[cfgDepth].extensionPrompts)) {
4473 finalMesSend[cfgDepth].extensionPrompts = [];
4474 }
4475 finalMesSend[cfgDepth].extensionPrompts.push(`${cfgPrompt.value}\n`);
4472 }4476 }
4473 finalMesSend[cfgDepth].extensionPrompts.push(`${cfgPrompt.value}\n`);
4474 }4477 }
4475 }4478 }
4476 }4479 }