Disable auto-mode in groups on user input

This commit is contained in:
Cohee
2023-06-12 18:15:18 +03:00
parent aaf3f00bef
commit 43701d378c

View File

@@ -1418,6 +1418,14 @@ function onGroupScenarioRemoveClick() {
$(this).closest('.group_scenario').find('.group_chat_scenario').val('').trigger('input'); $(this).closest('.group_scenario').find('.group_chat_scenario').val('').trigger('input');
} }
function onSendTextareaInput() {
if (is_group_automode_enabled) {
// Wait for current automode generation to finish
is_group_automode_enabled = false;
$("#rm_group_automode").prop("checked", false);
}
}
function stopAutoModeGeneration() { function stopAutoModeGeneration() {
if (groupAutoModeAbortController) { if (groupAutoModeAbortController) {
groupAutoModeAbortController.abort(); groupAutoModeAbortController.abort();
@@ -1440,4 +1448,5 @@ jQuery(() => {
is_group_automode_enabled = value; is_group_automode_enabled = value;
eventSource.once(event_types.GENERATION_STOPPED, stopAutoModeGeneration); eventSource.once(event_types.GENERATION_STOPPED, stopAutoModeGeneration);
}); });
$("#send_textarea").on("keyup", onSendTextareaInput);
}); });