Fix "continue" as a slash command

This commit is contained in:
Cohee
2023-07-02 23:59:33 +03:00
parent 16e8c7a3c8
commit 6d33e44519
2 changed files with 6 additions and 3 deletions

View File

@ -7139,7 +7139,8 @@ $(document).ready(function () {
///////////// OPTIMIZED LISTENERS FOR LEFT SIDE OPTIONS POPUP MENU ////////////////////// ///////////// OPTIMIZED LISTENERS FOR LEFT SIDE OPTIONS POPUP MENU //////////////////////
$("#options [id]").on("click", function () { $("#options [id]").on("click", function (event, customData) {
const fromSlashCommand = customData?.fromSlashCommand || false;
var id = $(this).attr("id"); var id = $(this).attr("id");
if (id == "option_select_chat") { if (id == "option_select_chat") {
@ -7184,7 +7185,7 @@ $(document).ready(function () {
} }
else if (id == 'option_continue') { else if (id == 'option_continue') {
if (is_send_press == false) { if (is_send_press == false || fromSlashCommand) {
is_send_press = true; is_send_press = true;
Generate("continue"); Generate("continue");
} }

View File

@ -117,7 +117,9 @@ const NARRATOR_NAME_DEFAULT = 'System';
const COMMENT_NAME_DEFAULT = 'Note'; const COMMENT_NAME_DEFAULT = 'Note';
function continueChatCallback() { function continueChatCallback() {
$('#option_continue').trigger('click'); // Prevent infinite recursion
$('#send_textarea').val('');
$('#option_continue').trigger('click', { fromSlashCommand: true });
} }
function syncCallback() { function syncCallback() {