thread fix
This commit is contained in:
parent
a58ba11566
commit
d0fee5c8f7
6 changed files with 262 additions and 34 deletions
|
|
@ -44,6 +44,7 @@ import {
|
|||
labelCounts,
|
||||
matchesLens,
|
||||
} from "../utils/inboxSignals";
|
||||
import { buildReplyBodyHtml } from "../utils/emailReply";
|
||||
|
||||
const PAGE_SIZE = 25;
|
||||
const CATEGORY_TABS = [
|
||||
|
|
@ -86,15 +87,12 @@ function buildReplyContext(message, replyAll = false) {
|
|||
const sender = message?.sender || { name: "", address: "" };
|
||||
const subject = (message?.subject || "").trim();
|
||||
const replySubject = /^re:/i.test(subject) ? subject : `Re: ${subject || "(No subject)"}`;
|
||||
const quote = (message?.new_reply_content || message?.body_text || message?.snippet || "").trim();
|
||||
return {
|
||||
replyToMessageId: message.id,
|
||||
replyAll,
|
||||
to: replyAll ? [] : [{ email: sender.address, name: sender.name }],
|
||||
subject: replySubject,
|
||||
bodyHtml: quote
|
||||
? `<p><br></p><blockquote>${quote.replace(/\n/g, "<br>")}</blockquote>`
|
||||
: "<p><br></p>",
|
||||
bodyHtml: buildReplyBodyHtml(message),
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -781,7 +779,7 @@ export default function MailboxView({
|
|||
const target = threadDetail?.messages?.[threadDetail.messages.length - 1] || detail;
|
||||
onCompose?.({
|
||||
subject: `Fwd: ${target?.subject || ""}`,
|
||||
bodyHtml: `<p><br></p><blockquote>${(target?.new_reply_content || target?.body_text || target?.snippet || "").replace(/\n/g, "<br>")}</blockquote>`,
|
||||
bodyHtml: buildReplyBodyHtml(target),
|
||||
});
|
||||
}}
|
||||
onExtractActions={() => detail && extractActions(detail)}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue