diff --git a/public/script.js b/public/script.js index 36582390c..1a0f32450 100644 --- a/public/script.js +++ b/public/script.js @@ -8575,8 +8575,10 @@ $(document).ready(function () { $(document).on("click", ".mes_edit_delete", async function (event, customData) { const fromSlashCommand = customData?.fromSlashCommand || false; + const swipeExists = (!chat[this_edit_mes_id].swipes || chat[this_edit_mes_id].swipes.length <= 1 || chat.is_user || parseInt(this_edit_mes_id) !== chat.length - 1); if (power_user.confirm_message_delete && fromSlashCommand !== true) { - const confirmation = await callPopup("Are you sure you want to delete this message?", 'confirm'); + const confirmation = swipeExists ? await callPopup("Are you sure you want to delete this message?", 'confirm') + : await callPopup("