Pages corrections widget
This commit is contained in:
parent
ed9dadd77a
commit
b6bb7b61ad
@ -228,32 +228,30 @@ export function Email() {
|
||||
items: notificationItems,
|
||||
});
|
||||
|
||||
// Dispatch event for Outlook-style notifications (for new emails detected by ID)
|
||||
if (hasNewEmails) {
|
||||
// Get only the newly arrived emails (by ID comparison)
|
||||
const newEmails = transformedEmails
|
||||
.filter(e => newEmailIds.has(e.id) && !e.read)
|
||||
.slice(0, 5); // Limit to 5 most recent new emails
|
||||
// Dispatch event for Outlook-style notifications (for new emails detected by ID)
|
||||
if (hasNewEmails) {
|
||||
// Get only the newly arrived emails (by ID comparison)
|
||||
const newEmails = transformedEmails
|
||||
.filter(e => newEmailIds.has(e.id) && !e.read)
|
||||
.slice(0, 5); // Limit to 5 most recent new emails
|
||||
|
||||
if (newEmails.length > 0) {
|
||||
console.log('[Email Widget] 📧 Dispatching new emails event', {
|
||||
newEmailsCount: newEmails.length,
|
||||
newEmailIds: Array.from(newEmailIds),
|
||||
previousCount: lastUnreadCountRef.current,
|
||||
currentCount: currentUnreadCount,
|
||||
previousEmailIds: Array.from(lastEmailIdsRef.current),
|
||||
});
|
||||
|
||||
if (newEmails.length > 0) {
|
||||
console.log('[Email Widget] 📧 Dispatching new emails event', {
|
||||
newEmailsCount: newEmails.length,
|
||||
newEmailIds: Array.from(newEmailIds),
|
||||
previousCount,
|
||||
currentCount: currentUnreadCount,
|
||||
previousEmailIds: Array.from(lastEmailIdsRef.current),
|
||||
});
|
||||
|
||||
window.dispatchEvent(new CustomEvent('new-emails-detected', {
|
||||
detail: {
|
||||
emails: transformedEmails,
|
||||
accountMap: accountMap,
|
||||
previousCount,
|
||||
currentCount: currentUnreadCount,
|
||||
}
|
||||
}));
|
||||
window.dispatchEvent(new CustomEvent('new-emails-detected', {
|
||||
detail: {
|
||||
emails: transformedEmails,
|
||||
accountMap: accountMap,
|
||||
previousCount: lastUnreadCountRef.current,
|
||||
currentCount: currentUnreadCount,
|
||||
}
|
||||
}
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user