Calculate warning properly for all methods of attachment download
This commit is contained in:
parent
f01c5f3e68
commit
7789beec64
1 changed files with 7 additions and 1 deletions
|
@ -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>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue