fix: fall back to a real tab title for subject-less Pro forward-as-attachment

buildForwardAsAttachmentPayload intentionally returns an empty subject
for a subject-less email (matching normal Forward's composer-subject
behavior, fixed in 3bfa73f3), but this handler was reusing that same
empty string as the Pro compose tab's title. handleForward, right
above it, already computes its title with a fallback
(email.subject || t('email_composer.new_message')) before prefixing -
mirror that instead of reusing payload.subject for the title.

Caught by GitHub Copilot's automated PR review.
This commit is contained in:
Aaron Guise
2026-07-27 20:38:02 +12:00
parent 3bfa73f375
commit 0a1114f710
+7 -1
View File
@@ -171,7 +171,13 @@ export function ProEmailTabBody({ tabId, data }: ProEmailTabBodyProps) {
attachments: [payload.attachment], attachments: [payload.attachment],
}, },
sourceEmailId: email.id, sourceEmailId: email.id,
title: payload.subject, // payload.subject is intentionally blank for a subject-less email (to
// match normal Forward's *composer* subject behavior - see
// buildForwardAsAttachmentPayload). The Pro tab *title* is a separate
// UI label that still needs a sensible fallback, same as handleForward
// above uses - reusing payload.subject here would give the tab an
// empty title instead of e.g. "Fwd: New message".
title: buildForwardSubject(email.subject || t('email_composer.new_message'), t('email_composer.prefix.forward')),
}); });
}, [email, openComposeTab, t]); }, [email, openComposeTab, t]);