mirror of
https://github.com/bulwarkmail/native.git
synced 2026-11-01 16:05:39 +00:00
fix: list a signed message's attachments once in the reader #58
This commit is contained in:
@@ -76,8 +76,10 @@ export function MessageContent({
|
||||
? secure.result.body ?? (secure.result.status.encrypted ? { html: null, text: '' } : null)
|
||||
: null;
|
||||
const bodyOverride = secureBody ?? unwrap.override;
|
||||
// Only an encrypted message hides its attachments from the server; a
|
||||
// signed one has them listed already.
|
||||
const extracted = React.useMemo(
|
||||
() => (secure.result?.attachments.length ? [...secure.result.attachments, ...unwrap.extracted] : unwrap.extracted),
|
||||
() => (secure.result?.status.encrypted && secure.result.attachments.length ? [...secure.result.attachments, ...unwrap.extracted] : unwrap.extracted),
|
||||
[secure.result, unwrap.extracted],
|
||||
);
|
||||
const calendarBannerShown = calendarBannerShownFor(email, calendarParsing);
|
||||
|
||||
@@ -31,5 +31,7 @@ describe('reader wiring', () => {
|
||||
expect(reader).toMatch(/const secure = useSecureMessage\(email, jmapAccountId\);/);
|
||||
expect(reader).toMatch(/bodyOverride=\{bodyOverride\}/);
|
||||
expect(reader).toMatch(/<SecureMessageBanner status=/);
|
||||
// A signed message's attachments are already listed by the server.
|
||||
expect(reader).toMatch(/secure\.result\?\.status\.encrypted && secure\.result\.attachments\.length/);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user