diff --git a/public/script.js b/public/script.js index a61a136f6..2a06a29bd 100644 --- a/public/script.js +++ b/public/script.js @@ -1682,9 +1682,9 @@ async function Generate(type, automatic_trigger, force_name2) { is_add_personality = true; //chatString = chatString.substr(0,chatString.length-1); //anchorAndPersonality = "[Genre: roleplay chat][Tone: very long messages with descriptions]"; - if ((anchorTop != "" || charPersonality != "") && !is_pygmalion) { - if (anchorTop != "") charPersonality += ' '; - item += "[" + charPersonality + anchorTop + ']\n'; + let personalityAndAnchor = [ charPersonality, anchorTop ].filter(x => x).join(' '); + if (personalityAndAnchor && !is_pygmalion) { + item += "[" + personalityAndAnchor + ']\n'; } } if (i >= arrMes.length - 1 && count_view_mes > 8 && $.trim(item).substr(0, (name1 + ":").length) == name1 + ":" && !is_pygmalion) {//For add anchor in end