mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-07-08 11:56:59 +00:00
Show overlays during bulk email delete
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user