diff options
author | Chris <ccbrown112@gmail.com> | 2017-09-05 12:13:03 -0500 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2017-09-05 13:13:03 -0400 |
commit | c4e32060bef6ad2c6a2c8dfb8cdb8ad34d0f302e (patch) | |
tree | 7d47e35f483ea476f71371e08fb92f325c43750d /webapp/components/file_preview.jsx | |
parent | 575864c917dbbe6b58d3e4534c3015327f2cb088 (diff) | |
download | chat-c4e32060bef6ad2c6a2c8dfb8cdb8ad34d0f302e.tar.gz chat-c4e32060bef6ad2c6a2c8dfb8cdb8ad34d0f302e.tar.bz2 chat-c4e32060bef6ad2c6a2c8dfb8cdb8ad34d0f302e.zip |
fix svg thumbnails and non-png copy/pastes (#7348)
Diffstat (limited to 'webapp/components/file_preview.jsx')
-rw-r--r-- | webapp/components/file_preview.jsx | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/webapp/components/file_preview.jsx b/webapp/components/file_preview.jsx index 3ec656fd4..a53134f7e 100644 --- a/webapp/components/file_preview.jsx +++ b/webapp/components/file_preview.jsx @@ -9,7 +9,7 @@ import loadingGif from 'images/load.gif'; import Constants from 'utils/constants.jsx'; import * as Utils from 'utils/utils.jsx'; -import {getFileThumbnailUrl} from 'mattermost-redux/utils/file_utils'; +import {getFileUrl, getFileThumbnailUrl} from 'mattermost-redux/utils/file_utils'; export default class FilePreview extends React.Component { static propTypes = { @@ -47,7 +47,14 @@ export default class FilePreview extends React.Component { let className = 'file-preview'; let previewImage; - if (type === 'image' || type === 'svg') { + if (type === 'svg') { + previewImage = ( + <img + className='post-image normal' + src={getFileUrl(info.id)} + /> + ); + } else if (type === 'image') { let imageClassName = 'post-image'; if (info.width < Constants.THUMBNAIL_WIDTH && info.height < Constants.THUMBNAIL_HEIGHT) { |