From b8e79ad2e70f4c981db7b4e1d2cd3adf581d1074 Mon Sep 17 00:00:00 2001 From: alma Date: Fri, 25 Apr 2025 10:20:37 +0200 Subject: [PATCH] panel 2 courrier estore --- app/courrier/page.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/courrier/page.tsx b/app/courrier/page.tsx index 38fdb857..bac700ef 100644 --- a/app/courrier/page.tsx +++ b/app/courrier/page.tsx @@ -48,6 +48,7 @@ export interface Email { to: string; subject: string; content: string; + body?: string; // For backward compatibility date: string; read: boolean; starred: boolean; @@ -1222,7 +1223,7 @@ export default function CourrierPage() { ); - // Update handleReply function + // Update handleReply to include body property for backward compatibility const handleReply = async (type: 'reply' | 'reply-all' | 'forward') => { if (!selectedEmail) return; @@ -1245,6 +1246,12 @@ export default function CourrierPage() { return subject.startsWith('Re:') ? subject : `Re: ${subject}`; }; + // Add body property for backward compatibility + const emailWithBody = { + ...selectedEmail, + body: selectedEmail.content // Add body property that maps to content + }; + // Set the appropriate flags setIsReplying(type === 'reply' || type === 'reply-all'); setIsForwarding(type === 'forward'); @@ -1259,6 +1266,10 @@ export default function CourrierPage() { setShowBcc(false); setAttachments([]); + // Pass the email with both content and body properties + setReplyToEmail(emailWithBody); + setForwardEmail(type === 'forward' ? emailWithBody : null); + } catch (error) { console.error('Error preparing reply:', error); }