diff --git a/app/[locale]/page.tsx b/app/[locale]/page.tsx index 9cb62eb9..3d4b0273 100644 --- a/app/[locale]/page.tsx +++ b/app/[locale]/page.tsx @@ -519,7 +519,10 @@ export default function Home() { const handleEditDraft = async (email?: Email) => { if (!client) return; - let draft = email || selectedEmail; + const draftCandidate = email && typeof email === 'object' && typeof email.id === 'string' + ? email + : selectedEmail; + let draft = draftCandidate; if (!draft) return; // The email list only fetches limited properties (no bodyValues/htmlBody/bcc). diff --git a/components/email/email-viewer.tsx b/components/email/email-viewer.tsx index 2e5f585a..1081b51a 100644 --- a/components/email/email-viewer.tsx +++ b/components/email/email-viewer.tsx @@ -2805,7 +2805,7 @@ export function EmailViewer({ {isDraft && onEditDraft ? (