Fix /cut command

This commit is contained in:
Cohee
2023-07-13 20:00:17 +03:00
parent 02c4c7d1d0
commit 22108c5c9f
2 changed files with 7 additions and 5 deletions

View File

@@ -7967,8 +7967,9 @@ $(document).ready(function () {
});
$(document).on("click", ".mes_edit_delete", async function () {
if (power_user.confirm_message_delete) {
$(document).on("click", ".mes_edit_delete", async function (event, customData) {
const fromSlashCommand = customData?.fromSlashCommand || false;
if (power_user.confirm_message_delete && fromSlashCommand !== true) {
const confirmation = await callPopup("Are you sure you want to delete this message?", 'confirm');
if (!confirmation) {
return;

View File

@@ -16,7 +16,8 @@ import {
name1,
name2,
replaceCurrentChat,
setCharacterId
setCharacterId,
setEditedMessageId
} from "../script.js";
import { favsToHotswap, isMobile, initMovingUI } from "./RossAscends-mods.js";
import {
@@ -1123,8 +1124,8 @@ async function doMesCut(_, text) {
return
}
mesToCut.find('.mes_edit_delete').trigger('click');
$('#dialogue_popup_ok').trigger('click');
setEditedMessageId(mesIDToCut);
mesToCut.find('.mes_edit_delete').trigger('click', { fromSlashCommand: true });
}