Neah version mail remove mail correction 6
This commit is contained in:
parent
1407050052
commit
2173232f67
@ -601,11 +601,13 @@ export default function MailPage() {
|
|||||||
flags: email.flags || []
|
flags: email.flags || []
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// Update unread count for INBOX
|
// Only update unread count if we're in the Inbox folder
|
||||||
const unreadInboxEmails = processedEmails.filter(
|
if (currentView === 'INBOX') {
|
||||||
(email: Email) => !email.read && email.folder === 'INBOX'
|
const unreadInboxEmails = processedEmails.filter(
|
||||||
).length;
|
(email: Email) => !email.read && email.folder === 'INBOX'
|
||||||
setUnreadCount(unreadInboxEmails);
|
).length;
|
||||||
|
setUnreadCount(unreadInboxEmails);
|
||||||
|
}
|
||||||
|
|
||||||
// Update emails state based on whether we're loading more
|
// Update emails state based on whether we're loading more
|
||||||
if (isLoadMore) {
|
if (isLoadMore) {
|
||||||
@ -1550,11 +1552,6 @@ export default function MailPage() {
|
|||||||
}
|
}
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
setEmails(data.emails);
|
setEmails(data.emails);
|
||||||
|
|
||||||
// Only update unread count when switching to Inbox
|
|
||||||
if (newMailbox === 'INBOX') {
|
|
||||||
setUnreadCount(data.unreadCount);
|
|
||||||
}
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
setError(err instanceof Error ? err.message : 'Failed to fetch emails');
|
setError(err instanceof Error ? err.message : 'Failed to fetch emails');
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user