mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Move "continue on send" logic out of Generate()
This commit is contained in:
@ -1477,7 +1477,22 @@ export async function reloadCurrentChat() {
|
|||||||
*/
|
*/
|
||||||
export function sendTextareaMessage() {
|
export function sendTextareaMessage() {
|
||||||
if (is_send_press) return;
|
if (is_send_press) return;
|
||||||
Generate();
|
|
||||||
|
let generateType;
|
||||||
|
// "Continue on send" is activated when the user hits "send" (or presses enter) on an empty chat box, and the last
|
||||||
|
// message was sent from a character (not the user or the system).
|
||||||
|
const textareaText = String($('#send_textarea').val());
|
||||||
|
if (power_user.continue_on_send &&
|
||||||
|
!textareaText &&
|
||||||
|
!selected_group &&
|
||||||
|
chat.length &&
|
||||||
|
!chat[chat.length - 1]['is_user'] &&
|
||||||
|
!chat[chat.length - 1]['is_system']
|
||||||
|
) {
|
||||||
|
generateType = 'continue';
|
||||||
|
}
|
||||||
|
|
||||||
|
Generate(generateType);
|
||||||
}
|
}
|
||||||
|
|
||||||
function messageFormatting(mes, ch_name, isSystem, isUser) {
|
function messageFormatting(mes, ch_name, isSystem, isUser) {
|
||||||
@ -3055,10 +3070,6 @@ async function Generate(type, { automatic_trigger, force_name2, quiet_prompt, qu
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!type && !textareaText && power_user.continue_on_send && !selected_group && chat.length && !chat[chat.length - 1]['is_user'] && !chat[chat.length - 1]['is_system']) {
|
|
||||||
type = 'continue';
|
|
||||||
}
|
|
||||||
|
|
||||||
const isContinue = type == 'continue';
|
const isContinue = type == 'continue';
|
||||||
|
|
||||||
// Rewrite the generation timer to account for the time passed for all the continuations.
|
// Rewrite the generation timer to account for the time passed for all the continuations.
|
||||||
|
Reference in New Issue
Block a user