diff --git a/public/css/popup.css b/public/css/popup.css index bdd530a66..045bfc2e5 100644 --- a/public/css/popup.css +++ b/public/css/popup.css @@ -115,12 +115,10 @@ dialog { background-color: var(--crimson-hover); } -.menu_button.popup-button-custom { - /* Custom buttons should not scale to smallest size, otherwise they will always break to multiline */ - width: unset; -} - .popup-controls .menu_button { + /* Popup buttons should not scale to smallest size, otherwise they will always break to multiline if multiple words */ + width: unset; + /* Fix weird animation issue with fonts on brightness filter */ backface-visibility: hidden; transform: translateZ(0); diff --git a/public/script.js b/public/script.js index 6fd8a8697..a596ebcee 100644 --- a/public/script.js +++ b/public/script.js @@ -228,7 +228,7 @@ import { appendFileContent, hasPendingFileAttachment, populateFileAttachment, de import { initPresetManager } from './scripts/preset-manager.js'; import { evaluateMacros } from './scripts/macros.js'; import { currentUser, setUserControls } from './scripts/user.js'; -import { POPUP_TYPE, Popup, callGenericPopup, fixToastrForDialogs } from './scripts/popup.js'; +import { POPUP_RESULT, POPUP_TYPE, Popup, callGenericPopup, fixToastrForDialogs } from './scripts/popup.js'; import { renderTemplate, renderTemplateAsync } from './scripts/templates.js'; import { ScraperManager } from './scripts/scrapers.js'; import { SlashCommandParser } from './scripts/slash-commands/SlashCommandParser.js'; @@ -10085,26 +10085,32 @@ jQuery(async function () { $(document).on('click', '.mes_edit_delete', async function (event, customData) { const fromSlashCommand = customData?.fromSlashCommand || false; - const swipeExists = (!Array.isArray(chat[this_edit_mes_id].swipes) || chat[this_edit_mes_id].swipes.length <= 1 || chat[this_edit_mes_id].is_user || parseInt(this_edit_mes_id) !== chat.length - 1); + const canDeleteSwipe = (Array.isArray(chat[this_edit_mes_id].swipes) && chat[this_edit_mes_id].swipes.length > 1 && !chat[this_edit_mes_id].is_user && parseInt(this_edit_mes_id) === chat.length - 1); + + let deleteOnlySwipe = false; if (power_user.confirm_message_delete && fromSlashCommand !== true) { - const confirmation = swipeExists ? await callPopup('Are you sure you want to delete this message?', 'confirm') - : await callPopup('