courrier preview

This commit is contained in:
alma 2025-04-30 23:43:40 +02:00
parent 7fcf4d5ea8
commit bf19cd5015

View File

@ -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({
<div className="flex items-center w-full">
{getFolderIcon(baseFolderName)}
<span className="ml-2 truncate text-gray-700">{formatFolderName(baseFolderName)}</span>
{folderUnreadCount > 0 && (
{isInboxFolder && folderUnreadCount > 0 && (
<span className="ml-auto bg-blue-500 text-white text-[10px] px-1.5 rounded-full">
{folderUnreadCount}
</span>