Fix attachments being sent on irregular generation types Fixes #2763

0db9bc65916a727b26537a404cba43586c12e588

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

1 files changed, +10 -1Ignore whitespace
public/script.js+10 -1
@@ -3477,8 +3477,17 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
34773477 //PRE FORMATING STRING
34783478 //*********************************
34793479
3480+ // These generation types should not attach pending files to the chat
3481+ const noAttachTypes = [
3482+ 'regenerate',
3483+ 'swipe',
3484+ 'impersonate',
3485+ 'quiet',
3486+ 'continue',
3487+ 'ask_command',
3488+ ];
34803489 //for normal messages sent from user..
34813490 if ((textareaText != '' || (hasPendingFileAttachment() && !noAttachTypes.includes(type))) && !automatic_trigger && type !== 'quiet' && !dryRun) {
34823491 // If user message contains no text other than bias - send as a system message
34833492 if (messageBias && !removeMacros(textareaText)) {
34843493 sendSystemMessage(system_message_types.GENERIC, ' ', { bias: messageBias });