courrier preview

This commit is contained in:
alma 2025-05-01 22:06:21 +02:00
parent b859b733f6
commit fc8276494d
2 changed files with 6 additions and 2 deletions

View File

@ -32,6 +32,8 @@ const toastVariants = cva(
default: "border bg-background text-foreground",
destructive:
"destructive group border-destructive bg-destructive text-destructive-foreground",
"new-email":
"border-blue-500 bg-blue-600 text-white",
},
},
defaultVariants: {

View File

@ -603,14 +603,16 @@ export const useEmailState = () => {
if (data.newestEmailId && data.newestEmailId > lastKnownEmailId) {
logEmailOp('NEW_EMAILS', `Found new emails, newest ID: ${data.newestEmailId} (current: ${lastKnownEmailId})`);
// Show a toast notification
// Show a toast notification with the new custom variant
toast({
variant: "new-email", // Use our new custom variant
title: "New emails",
description: "You have new emails in your inbox",
duration: 5000
});
// Force refresh the current view to show the new emails
// Force refresh the current view to show the new emails immediately
// This ensures panel 2 (email list) gets updated
loadEmails(1, state.perPage, false);
} else {
logEmailOp('CHECK_NEW_EMAILS', 'No new emails found');