Fix /del command (for real this time)

This commit is contained in:
Cohee
2023-11-08 23:42:44 +02:00
parent aae8707460
commit 9667b82599
2 changed files with 4 additions and 5 deletions

View File

@ -5439,10 +5439,10 @@ function updateMessage(div) {
return { mesBlock, text, mes, bias }; return { mesBlock, text, mes, bias };
} }
function openMessageDelete() { function openMessageDelete(fromSlashCommand) {
closeMessageEditor(); closeMessageEditor();
hideSwipeButtons(); hideSwipeButtons();
if ((this_chid != undefined && !is_send_press) || (selected_group && !is_group_generating)) { if (fromSlashCommand || (this_chid != undefined && !is_send_press) || (selected_group && !is_group_generating)) {
$("#dialogue_del_mes").css("display", "block"); $("#dialogue_del_mes").css("display", "block");
$("#send_form").css("display", "none"); $("#send_form").css("display", "none");
$(".del_checkbox").each(function () { $(".del_checkbox").each(function () {
@ -7999,7 +7999,7 @@ jQuery(async function () {
} }
else if (id == "option_delete_mes") { else if (id == "option_delete_mes") {
setTimeout(openMessageDelete, animation_duration); setTimeout(() => openMessageDelete(fromSlashCommand), animation_duration);
} }
else if (id == "option_close_chat") { else if (id == "option_close_chat") {

View File

@ -1814,9 +1814,8 @@ async function doMesCut(_, text) {
} }
async function doDelMode(_, text) { async function doDelMode(_, text) {
//first enter delmode //first enter delmode
$("#option_delete_mes").trigger('click') $("#option_delete_mes").trigger('click', { fromSlashCommand: true });
//reject invalid args //reject invalid args
if (text && isNaN(text)) { if (text && isNaN(text)) {