courrier multi account restore compose

This commit is contained in:
alma 2025-04-28 21:22:56 +02:00
parent 5fb4e623db
commit 8967b27f17

View File

@ -82,22 +82,18 @@ export default function EmailPanel({
// If content is already an object with html/text, use it directly // If content is already an object with html/text, use it directly
if (email.content && typeof email.content === 'object') { if (email.content && typeof email.content === 'object') {
console.log('EmailPanel: Using existing content object'); console.log('EmailPanel: Using existing content object');
return { return email;
...email,
content: email.content.html || email.content.text || '',
html: email.content.html || email.html || '',
text: email.content.text || email.text || ''
};
} }
// If content is a string, format it // If content is a string, convert it to object format
if (typeof email.content === 'string') { if (typeof email.content === 'string') {
console.log('EmailPanel: Using direct string content'); console.log('EmailPanel: Converting string content to object');
return { return {
...email, ...email,
content: email.content, content: {
html: email.html || email.content, text: email.text || email.content,
text: email.text || email.content html: email.html || email.content
}
}; };
} }
@ -105,9 +101,10 @@ export default function EmailPanel({
console.log('EmailPanel: Using html/text properties'); console.log('EmailPanel: Using html/text properties');
return { return {
...email, ...email,
content: email.html || email.text || '', content: {
html: email.html || '', text: email.text || '',
text: email.text || '' html: email.html || ''
}
}; };
}, [email]); }, [email]);