feat: implement tag counts fetching and display in sidebar and email components

This commit is contained in:
Linus Rath
2026-03-14 17:12:38 +01:00
parent f995558bf5
commit f7bbab5e4a
5 changed files with 107 additions and 4 deletions
+8 -1
View File
@@ -108,6 +108,7 @@ export default function Home() {
selectedKeyword,
selectKeyword,
hasMoreEmails,
fetchTagCounts,
} = useEmailStore();
// Keyboard shortcuts handlers
@@ -299,6 +300,9 @@ export default function Home() {
await fetchEmails(client);
}
// Fetch tag counts
fetchTagCounts(client);
// Setup push notifications after successful data load
try {
// Register state change callback
@@ -330,7 +334,7 @@ export default function Home() {
client.closePushNotifications();
}
};
}, [isAuthenticated, client, mailboxes.length, fetchMailboxes, fetchEmails, fetchQuota, handleStateChange, setPushConnected]);
}, [isAuthenticated, client, mailboxes.length, fetchMailboxes, fetchEmails, fetchQuota, fetchTagCounts, handleStateChange, setPushConnected]);
// Handle mark-as-read with delay based on settings
useEffect(() => {
@@ -587,6 +591,9 @@ export default function Home() {
// Refresh emails list to show color in list
await fetchEmails(client, selectedMailbox);
// Refresh tag counts
fetchTagCounts(client);
} catch (error) {
console.error("Failed to set color tag:", error);
}