From bf19cd5015bae970f4aa83381e88967bd2f39d83 Mon Sep 17 00:00:00 2001 From: alma Date: Wed, 30 Apr 2025 23:43:40 +0200 Subject: [PATCH] courrier preview --- components/email/EmailSidebar.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/components/email/EmailSidebar.tsx b/components/email/EmailSidebar.tsx index b5fbf30b..40457226 100644 --- a/components/email/EmailSidebar.tsx +++ b/components/email/EmailSidebar.tsx @@ -172,8 +172,11 @@ export default function EmailSidebar({ // Get unread count - check all possible formats let folderUnreadCount = 0; - // First check if account exists in the map - if (unreadCount && unreadCount[accountId]) { + // Check if this is an inbox folder (only show unread counts for inbox folders) + const isInboxFolder = baseFolderName.toLowerCase().includes('inbox'); + + // Only calculate unread count for inbox folders + if (isInboxFolder && unreadCount && unreadCount[accountId]) { // Try the base folder name first if (typeof unreadCount[accountId][baseFolderName] === 'number') { folderUnreadCount = unreadCount[accountId][baseFolderName]; @@ -212,7 +215,7 @@ export default function EmailSidebar({
{getFolderIcon(baseFolderName)} {formatFolderName(baseFolderName)} - {folderUnreadCount > 0 && ( + {isInboxFolder && folderUnreadCount > 0 && ( {folderUnreadCount}