Calculate warning properly for all methods of attachment download

This commit is contained in:
Scott Nonnenberg 2018-10-23 14:11:30 -07:00
parent f01c5f3e68
commit 7789beec64

View file

@ -819,6 +819,8 @@ export class Message extends React.Component<Props, State> {
} = this.props; } = this.props;
const showRetry = status === 'error' && direction === 'outgoing'; const showRetry = status === 'error' && direction === 'outgoing';
const fileName = attachment ? attachment.fileName : null;
const isDangerous = isFileDangerous(fileName || '');
return ( return (
<ContextMenu id={triggerId}> <ContextMenu id={triggerId}>
@ -827,7 +829,11 @@ export class Message extends React.Component<Props, State> {
attributes={{ attributes={{
className: 'module-message__context__download', className: 'module-message__context__download',
}} }}
onClick={onDownload} onClick={() => {
if (onDownload) {
onDownload(isDangerous);
}
}}
> >
{i18n('downloadAttachment')} {i18n('downloadAttachment')}
</MenuItem> </MenuItem>