From 7789beec6496e5e60338ca5456ed5efabea7c90e Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Tue, 23 Oct 2018 14:11:30 -0700 Subject: [PATCH] Calculate warning properly for all methods of attachment download --- ts/components/conversation/Message.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ts/components/conversation/Message.tsx b/ts/components/conversation/Message.tsx index a7812a749..2e49ca98d 100644 --- a/ts/components/conversation/Message.tsx +++ b/ts/components/conversation/Message.tsx @@ -819,6 +819,8 @@ export class Message extends React.Component { } = this.props; const showRetry = status === 'error' && direction === 'outgoing'; + const fileName = attachment ? attachment.fileName : null; + const isDangerous = isFileDangerous(fileName || ''); return ( @@ -827,7 +829,11 @@ export class Message extends React.Component { attributes={{ className: 'module-message__context__download', }} - onClick={onDownload} + onClick={() => { + if (onDownload) { + onDownload(isDangerous); + } + }} > {i18n('downloadAttachment')}