Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion components/mail/mail-app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2514,13 +2514,19 @@ export function MailApp({ linkSegments }: MailAppProps = {}) {
if (isTogglingOff) {
// Disable the unread filter and show all emails
clearSearchFilters();
setSearchMailboxId("");
if (client) {
await fetchEmails(client, mailboxId);
}
} else {
// Enable unread filter
// Enable the unread filter, scoped to THIS folder. advancedSearch runs
// across every mailbox when no folder scope is set, so a folder-local
// "unread" badge (e.g. Inbox: 29) would open a list that also pulls
// unread from Trash/Spam/etc. Scope to the clicked mailbox so the view
// matches the count.
clearSearchFilters();
setSearchFilters({ isUnread: true });
setSearchMailboxId(mailboxId);
if (client) {
await advancedSearch(client);
}
Expand Down