fix: apply archive context-menu action to all selected emails # 212

This commit is contained in:
Linus Rath
2026-04-20 14:35:56 +02:00
parent aa7f886795
commit 24c53e5ce7
2 changed files with 14 additions and 2 deletions
+6 -2
View File
@@ -66,6 +66,7 @@ interface EmailContextMenuProps {
// Batch actions
onBatchMarkAsRead?: (read: boolean) => void;
onBatchDelete?: () => void;
onBatchArchive?: () => void;
onBatchMoveToMailbox?: (mailboxId: string) => void;
onBatchMarkAsSpam?: () => void;
onBatchUndoSpam?: () => void;
@@ -127,6 +128,7 @@ export function EmailContextMenu({
onUndoSpam,
onBatchMarkAsRead,
onBatchDelete,
onBatchArchive,
onBatchMoveToMailbox,
onBatchMarkAsSpam,
onBatchUndoSpam,
@@ -235,8 +237,10 @@ export function EmailContextMenu({
<ContextMenuItem
icon={Archive}
label={t("archive")}
onClick={() => handleAction(onArchive!)}
disabled={!onArchive}
onClick={() =>
handleAction(showBatchActions ? onBatchArchive! : onArchive!)
}
disabled={showBatchActions ? !onBatchArchive : !onArchive}
/>
{/* Delete */}