From fb2022fb1cb3c8023efd22316d570d9b26facbd1 Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Fri, 4 Aug 2017 14:05:33 -0400 Subject: PLT-6924 Added ability to disable file uploads/downloads on old mobile apps (#7117) --- webapp/components/view_image_popover_bar.jsx | 45 ++++++++++++++++------------ 1 file changed, 26 insertions(+), 19 deletions(-) (limited to 'webapp/components/view_image_popover_bar.jsx') diff --git a/webapp/components/view_image_popover_bar.jsx b/webapp/components/view_image_popover_bar.jsx index 88055b47b..6a092cbbe 100644 --- a/webapp/components/view_image_popover_bar.jsx +++ b/webapp/components/view_image_popover_bar.jsx @@ -1,13 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See License.txt for license information. -import {FormattedMessage} from 'react-intl'; - import PropTypes from 'prop-types'; - import React from 'react'; +import {FormattedMessage} from 'react-intl'; + +import * as FileUtils from 'utils/file_utils'; -export default class ViewImagePopoverBar extends React.Component { +export default class ViewImagePopoverBar extends React.PureComponent { render() { var publicLink = ''; if (global.window.mm_config.EnablePublicLink === 'true') { @@ -34,21 +34,9 @@ export default class ViewImagePopoverBar extends React.Component { footerClass += ' footer--show'; } - return ( -
- - - + let downloadLinks = null; + if (FileUtils.canDownloadFiles()) { + downloadLinks = (
{publicLink}
+ ); + } + + return ( +
+ + + + {downloadLinks}
); } -- cgit v1.2.3-1-g7c22