mail page fix design dang
This commit is contained in:
parent
02bfb0cea8
commit
da1e18a5ee
@ -686,9 +686,8 @@ export default function CourrierPage() {
|
||||
// Set the selected email first to show preview immediately
|
||||
setSelectedEmail(email);
|
||||
|
||||
try {
|
||||
// Fetch the full email content
|
||||
const response = await fetch(`/api/courrier/email/${emailId}`);
|
||||
const response = await fetch(`/api/mail/${emailId}`);
|
||||
if (!response.ok) {
|
||||
throw new Error('Failed to fetch full email content');
|
||||
}
|
||||
@ -706,7 +705,7 @@ export default function CourrierPage() {
|
||||
|
||||
// Try to mark as read in the background
|
||||
try {
|
||||
const markReadResponse = await fetch(`/api/courrier/mark-read`, {
|
||||
const markReadResponse = await fetch(`/api/mail/mark-read`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
@ -732,11 +731,6 @@ export default function CourrierPage() {
|
||||
} catch (error) {
|
||||
console.error('Error marking email as read:', error);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error fetching full email content:', error);
|
||||
// If we can't fetch the full content, at least show what we have
|
||||
setSelectedEmail(email);
|
||||
}
|
||||
};
|
||||
|
||||
// Add these improved handlers
|
||||
@ -1419,12 +1413,6 @@ export default function CourrierPage() {
|
||||
const handleReply = (type: 'reply' | 'reply-all' | 'forward') => {
|
||||
if (!selectedEmail) return;
|
||||
|
||||
// Ensure we have the email content
|
||||
if (!selectedEmail.body) {
|
||||
console.error('No email content available for reply/forward');
|
||||
return;
|
||||
}
|
||||
|
||||
const getReplyTo = () => {
|
||||
if (type === 'forward') return '';
|
||||
return selectedEmail.from;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user