don't inject empty jb

b8f7675d8ce41c43ac73c8cb549e8971f700ef98

InspectorCaracal <51038201+InspectorCaracal@users.noreply.github.com>

Signed
1 files changed, +3 -0Showing whitespace changes
public/script.js+3 -0
@@ -4214,6 +4214,8 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
4214 ? substituteParams(jailbreak, name1, name2, (power_user.sysprompt.post_history ?? ''))4214 ? substituteParams(jailbreak, name1, name2, (power_user.sysprompt.post_history ?? ''))
4215 : baseChatReplace(power_user.sysprompt.post_history, name1, name2);4215 : baseChatReplace(power_user.sysprompt.post_history, name1, name2);
42164216
4217 // Only inject the jb if there is one
4218 if (jailbreak && typeof(jailbreak) != 'undefined') {
4217 // When continuing generation of previous output, last user message precedes the message to continue4219 // When continuing generation of previous output, last user message precedes the message to continue
4218 if (isContinue) {4220 if (isContinue) {
4219 coreChat.splice(coreChat.length - 1, 0, { mes: jailbreak, is_user: true });4221 coreChat.splice(coreChat.length - 1, 0, { mes: jailbreak, is_user: true });
@@ -4222,6 +4224,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
4222 coreChat.push({ mes: jailbreak, is_user: true });4224 coreChat.push({ mes: jailbreak, is_user: true });
4223 }4225 }
4224 }4226 }
4227 }
42254228
4226 let chat2 = [];4229 let chat2 = [];
4227 let continue_mag = '';4230 let continue_mag = '';