From fc8276494d7999431ace5adb6af1cfa4a1876859 Mon Sep 17 00:00:00 2001 From: alma Date: Thu, 1 May 2025 22:06:21 +0200 Subject: [PATCH] courrier preview --- components/ui/toast.tsx | 2 ++ hooks/use-email-state.ts | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/components/ui/toast.tsx b/components/ui/toast.tsx index 521b94b0..7645d9fd 100644 --- a/components/ui/toast.tsx +++ b/components/ui/toast.tsx @@ -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: { diff --git a/hooks/use-email-state.ts b/hooks/use-email-state.ts index e9a9da72..074f8fe9 100644 --- a/hooks/use-email-state.ts +++ b/hooks/use-email-state.ts @@ -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');