Fix empty script injections on /listinjects

This commit is contained in:
Wolfsblvt 2024-10-01 01:30:20 +02:00
parent 56265540db
commit f6726db9fb
1 changed files with 2 additions and 2 deletions

View File

@ -1929,10 +1929,10 @@ async function listInjectsCallback(args) {
return `* **${id}**: <code>${inject.value}</code> (${positionName}, depth: ${inject.depth}, scan: ${inject.scan ?? false}, role: ${inject.role ?? extension_prompt_roles.SYSTEM})`; return `* **${id}**: <code>${inject.value}</code> (${positionName}, depth: ${inject.depth}, scan: ${inject.scan ?? false}, role: ${inject.role ?? extension_prompt_roles.SYSTEM})`;
}) })
.join('\n'); .join('\n');
return `### Script injections:\n${injectsStr}`; return `### Script injections:\n${injectsStr || 'No script injections for the current chat'}`;
}; };
return await slashCommandReturnHelper.doReturn(returnType ?? 'popup-html', chat_metadata.script_injects, { objectToStringFunc: buildTextValue }); return await slashCommandReturnHelper.doReturn(returnType ?? 'popup-html', chat_metadata.script_injects ?? {}, { objectToStringFunc: buildTextValue });
} }
/** /**