panel 2 courrier estore
This commit is contained in:
parent
c9007f29dc
commit
b8e79ad2e7
@ -48,6 +48,7 @@ export interface Email {
|
|||||||
to: string;
|
to: string;
|
||||||
subject: string;
|
subject: string;
|
||||||
content: string;
|
content: string;
|
||||||
|
body?: string; // For backward compatibility
|
||||||
date: string;
|
date: string;
|
||||||
read: boolean;
|
read: boolean;
|
||||||
starred: boolean;
|
starred: boolean;
|
||||||
@ -1222,7 +1223,7 @@ export default function CourrierPage() {
|
|||||||
</nav>
|
</nav>
|
||||||
);
|
);
|
||||||
|
|
||||||
// Update handleReply function
|
// Update handleReply to include body property for backward compatibility
|
||||||
const handleReply = async (type: 'reply' | 'reply-all' | 'forward') => {
|
const handleReply = async (type: 'reply' | 'reply-all' | 'forward') => {
|
||||||
if (!selectedEmail) return;
|
if (!selectedEmail) return;
|
||||||
|
|
||||||
@ -1245,6 +1246,12 @@ export default function CourrierPage() {
|
|||||||
return subject.startsWith('Re:') ? subject : `Re: ${subject}`;
|
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
|
// Set the appropriate flags
|
||||||
setIsReplying(type === 'reply' || type === 'reply-all');
|
setIsReplying(type === 'reply' || type === 'reply-all');
|
||||||
setIsForwarding(type === 'forward');
|
setIsForwarding(type === 'forward');
|
||||||
@ -1259,6 +1266,10 @@ export default function CourrierPage() {
|
|||||||
setShowBcc(false);
|
setShowBcc(false);
|
||||||
setAttachments([]);
|
setAttachments([]);
|
||||||
|
|
||||||
|
// Pass the email with both content and body properties
|
||||||
|
setReplyToEmail(emailWithBody);
|
||||||
|
setForwardEmail(type === 'forward' ? emailWithBody : null);
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error preparing reply:', error);
|
console.error('Error preparing reply:', error);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user