fix: ensure draft editing function is called correctly in EmailViewer component #60

This commit is contained in:
Linus Rath
2026-03-28 00:52:28 +01:00
parent d6b0714b4e
commit 574bd7ecef
2 changed files with 7 additions and 4 deletions
+4 -1
View File
@@ -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).