feat: implement empty folder functionality for junk and trash mailboxes with confirmation dialog

This commit is contained in:
Linus Rath
2026-03-15 15:47:58 +01:00
parent c24fabe977
commit b7fa25c314
14 changed files with 232 additions and 13 deletions
+5 -3
View File
@@ -473,12 +473,14 @@ export default function Home() {
const handleDelete = async () => {
if (!client || !selectedEmail) return;
// Check if we're currently in the trash folder
// Check if we're currently in the trash or junk folder
const currentMailbox = mailboxes.find(m => m.id === selectedMailbox);
const isInTrash = currentMailbox?.role === 'trash';
const isInJunk = currentMailbox?.role === 'junk';
const permanentlyDeleteJunk = useSettingsStore.getState().permanentlyDeleteJunk;
if (isInTrash) {
// In trash: confirm before permanently deleting
if (isInTrash || (isInJunk && permanentlyDeleteJunk)) {
// In trash or junk with permanent delete enabled: confirm before permanently deleting
const confirmed = await confirmDialog({
title: t('email_list.permanent_delete_confirm_title'),
message: t('email_list.permanent_delete_confirm_message'),