From 4d90eb3d445918ba9f16517a7895c58b4c2333e3 Mon Sep 17 00:00:00 2001 From: pewdiepie-archdaemon Date: Sun, 28 Jun 2026 23:42:53 +0000 Subject: [PATCH] Show overlays during bulk email delete --- static/js/emailLibrary.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/static/js/emailLibrary.js b/static/js/emailLibrary.js index 8ad3c39c3..0ddf0f427 100644 --- a/static/js/emailLibrary.js +++ b/static/js/emailLibrary.js @@ -6993,6 +6993,15 @@ async function _bulkAction(action) { if (cancelBtn) cancelBtn.disabled = true; if (selectAll) selectAll.disabled = true; if (countEl) countEl.textContent = `${verbing} ${uids.length}…`; + const deleteOverlays = action === 'delete' + ? uids.map(uid => { + const card = document.querySelector(`#email-lib-grid .doclib-card[data-uid="${CSS.escape(String(uid))}"]`); + return _showEmailDeleteOverlay(card); + }).filter(Boolean) + : []; + if (deleteOverlays.length) { + await Promise.all(deleteOverlays.map(busy => busy.ready).filter(Boolean)); + } // Single-uid worker. const handleOne = async (uid) => { @@ -7059,6 +7068,9 @@ async function _bulkAction(action) { }); if (action === 'archive' || action === 'delete') { + if (action === 'delete') { + deleteOverlays.forEach(busy => busy.remove?.()); + } await _animateEmailCardRemoval(uids); const removed = new Set(uids.map(uid => String(uid))); state._libEmails = state._libEmails.filter(e => !removed.has(String(e.uid))); @@ -7072,6 +7084,7 @@ async function _bulkAction(action) { state._libEmails = state._libEmails.filter(e => !removed.has(String(e.uid))); } } finally { + deleteOverlays.forEach(busy => busy.remove?.()); if (busySpinner) busySpinner.destroy(); // Restore whichever button we hijacked (delete vs actions). if (targetBtn) {