('[data-overflow-item]').forEach((item) => {
- const key = TOOLBAR_PRIORITY_ACTIONS[item.dataset.overflowPriority ?? ''];
+ // A button standing in for another (Not spam in Archive's place) says which entry it is.
+ const key = item.dataset.overflowAction !== undefined
+ ? item.dataset.overflowAction as MessageActionKey
+ : TOOLBAR_PRIORITY_ACTIONS[item.dataset.overflowPriority ?? ''];
if (key && item.getClientRects().length > 0) shown.add(key);
});
if (isMobile && !mvMobileViewer) {
@@ -4467,8 +4485,40 @@ ${printWatermark ? printWatermark.html : ''}
{/* Right: Organize actions - order: archive, delete, move, tag, spam, read state, print, view source */}
{!isScheduled && (
- {/* Archive */}
- {archiveActionEnabled && (
+ {/* Archive. In Spam "Not spam" takes its place, in Trash "Restore". */}
+ {isInJunkFolder && onUndoSpam && (
+
+ )}
+ {isInTrashFolder && restoreTarget && onMoveToMailbox && (
+
+ )}
+ {archiveActionEnabled && !isInJunkFolder && !isInTrashFolder && (
{/* Move to folder */}
{moveTree.length > 0 && onMoveToMailbox && (
@@ -4558,7 +4609,7 @@ ${printWatermark ? printWatermark.html : ''}
{/* Spam */}
- {spamApplicable && (onMarkAsSpam || onUndoSpam) && (
+ {spamApplicable && !isInJunkFolder && onMarkAsSpam && (