Calculate warning properly for all methods of attachment download
This commit is contained in:
@@ -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>
|
||||||
|
Reference in New Issue
Block a user