Skip to content

Commit

Permalink
Calculate warning properly for all methods of attachment download
Browse files Browse the repository at this point in the history
  • Loading branch information
scottnonnenberg-signal committed Oct 23, 2018
1 parent f01c5f3 commit 7789bee
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ts/components/conversation/Message.tsx
Expand Up @@ -819,6 +819,8 @@ export class Message extends React.Component<Props, State> {
} = this.props;

const showRetry = status === 'error' && direction === 'outgoing';
const fileName = attachment ? attachment.fileName : null;
const isDangerous = isFileDangerous(fileName || '');

return (
<ContextMenu id={triggerId}>
Expand All @@ -827,7 +829,11 @@ export class Message extends React.Component<Props, State> {
attributes={{
className: 'module-message__context__download',
}}
onClick={onDownload}
onClick={() => {
if (onDownload) {
onDownload(isDangerous);
}
}}
>
{i18n('downloadAttachment')}
</MenuItem>
Expand Down

0 comments on commit 7789bee

Please sign in to comment.