fix: improve draft handling in email composer and enhance session cookie verification logic

This commit is contained in:
Linus Rath
2026-03-20 15:45:25 +01:00
parent c5b1731a63
commit c1c06c68bb
3 changed files with 29 additions and 12 deletions
+3 -1
View File
@@ -471,7 +471,9 @@ export default function Home() {
};
const handleEditDraft = (email?: Email) => {
const draft = email || selectedEmail;
// Guard: when used directly as an onClick handler, the click event is passed
// as the first argument. Detect this and fall back to selectedEmail.
const draft = (email && 'mailboxIds' in email) ? email : selectedEmail;
if (!draft) return;
const bodyText = draft.bodyValues
? Object.values(draft.bodyValues).map(v => v.value).join('\n')