Skip to content

Commit

Permalink
MM-14484 Remove download attribute from Open external image link (mat…
Browse files Browse the repository at this point in the history
  • Loading branch information
hmhealey committed Apr 15, 2019
1 parent cf1eca3 commit efe092a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ exports[`components/view_image/popover_bar/PopoverBar should match snapshot for
>
<a
className="text"
download="img.png"
href=""
rel="noopener noreferrer"
target="_blank"
Expand Down
9 changes: 7 additions & 2 deletions components/view_image/popover_bar/popover_bar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,11 @@ export default class PopoverBar extends React.PureComponent {

let downloadLinks = null;
if (this.props.canDownloadFiles) {
const shouldOpenFile = this.props.isExternalFile && !this.props.isDesktopApp;

let downloadLinkText;
if (this.props.isExternalFile && !this.props.isDesktopApp) {
const downloadLinkProps = {};
if (shouldOpenFile) {
downloadLinkText = (
<FormattedMessage
id='view_image_popover.open'
Expand All @@ -72,17 +75,19 @@ export default class PopoverBar extends React.PureComponent {
defaultMessage='Download'
/>
);

downloadLinkProps.download = this.props.filename;
}

downloadLinks = (
<div className='image-links'>
{publicLink}
<a
href={this.props.fileURL}
download={this.props.filename}
className='text'
target='_blank'
rel='noopener noreferrer'
{...downloadLinkProps}
>
{downloadLinkText}
</a>
Expand Down

0 comments on commit efe092a

Please sign in to comment.