diff --git a/public/script.js b/public/script.js index cdf9f5569..d3655ecdf 100644 --- a/public/script.js +++ b/public/script.js @@ -7139,7 +7139,8 @@ $(document).ready(function () { ///////////// 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"); if (id == "option_select_chat") { @@ -7184,7 +7185,7 @@ $(document).ready(function () { } else if (id == 'option_continue') { - if (is_send_press == false) { + if (is_send_press == false || fromSlashCommand) { is_send_press = true; Generate("continue"); } diff --git a/public/scripts/slash-commands.js b/public/scripts/slash-commands.js index 312561779..f5f040342 100644 --- a/public/scripts/slash-commands.js +++ b/public/scripts/slash-commands.js @@ -117,7 +117,9 @@ const NARRATOR_NAME_DEFAULT = 'System'; const COMMENT_NAME_DEFAULT = 'Note'; function continueChatCallback() { - $('#option_continue').trigger('click'); + // Prevent infinite recursion + $('#send_textarea').val(''); + $('#option_continue').trigger('click', { fromSlashCommand: true }); } function syncCallback() {