@bobfrankston/rmfmail 1.1.245 → 1.1.246

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8023,8 +8023,16 @@ async function deleteSelectedMessages() {
8023
8023
  if (!current) return;
8024
8024
  selected.push({ accountId: current.accountId, uid: current.message.uid, folderId: current.message.folderId });
8025
8025
  }
8026
- if (selected.length > 1) {
8027
- if (!confirm(`Move ${selected.length} messages to Trash?
8026
+ const inTrash = currentFolderSpecialUse === "trash";
8027
+ const n = selected.length;
8028
+ if (inTrash) {
8029
+ if (!confirm(`Permanently delete ${n} message${n === 1 ? "" : "s"} from Trash?
8030
+
8031
+ This cannot be undone.`)) {
8032
+ return;
8033
+ }
8034
+ } else if (n > 1) {
8035
+ if (!confirm(`Move ${n} messages to Trash?
8028
8036
 
8029
8037
  (Ctrl+Z restores them if this was a mistake.)`)) {
8030
8038
  return;
@@ -8033,8 +8041,12 @@ async function deleteSelectedMessages() {
8033
8041
  const statusSync = document.getElementById("status-sync");
8034
8042
  const snapshot = [...selected];
8035
8043
  removeMessagesAndReconcile(selected);
8036
- pushUndo({ kind: "delete", at: Date.now(), payload: snapshot.map((m) => ({ ...m, subject: "" })) });
8037
- if (statusSync) statusSync.textContent = snapshot.length === 1 ? `Trashed 1 message (syncing) \u2014 Ctrl+Z to undo` : `Trashed ${snapshot.length} messages (syncing) \u2014 Ctrl+Z to undo`;
8044
+ if (inTrash) {
8045
+ if (statusSync) statusSync.textContent = `Permanently deleted ${n} message${n === 1 ? "" : "s"}`;
8046
+ } else {
8047
+ pushUndo({ kind: "delete", at: Date.now(), payload: snapshot.map((m) => ({ ...m, subject: "" })) });
8048
+ if (statusSync) statusSync.textContent = n === 1 ? `Trashed 1 message (syncing) \u2014 Ctrl+Z to undo` : `Trashed ${n} messages (syncing) \u2014 Ctrl+Z to undo`;
8049
+ }
8038
8050
  const byAccount = /* @__PURE__ */ new Map();
8039
8051
  for (const msg of snapshot) {
8040
8052
  const g = byAccount.get(msg.accountId) || { uids: [], folderIds: [] };