RN-337 Enable GIF support in image preview (#928)

This commit is contained in:
Chris Duarte 2017-09-22 07:15:44 -07:00 committed by enahum
parent a5eecb9fb3
commit 9a5e7ac541
3 changed files with 6 additions and 2 deletions

View file

@ -64,7 +64,7 @@ export default class FileAttachment extends PureComponent {
const style = getStyleSheet(theme);
let fileAttachmentComponent;
if (file.has_preview_image || file.loading) {
if (file.has_preview_image || file.loading || file.mime_type === 'image/gif') {
fileAttachmentComponent = (
<FileAttachmentImage
addFileToFetchCache={this.props.addFileToFetchCache}

View file

@ -327,7 +327,7 @@ export default class ImagePreview extends PureComponent {
>
{this.props.files.map((file, index) => {
let component;
if (file.has_preview_image) {
if (file.has_preview_image || file.mime_type === 'image/gif') {
component = (
<Previewer
ref={(c) => {

View file

@ -195,6 +195,10 @@ export default class Previewer extends Component {
handleGetImageURL = () => {
const {file} = this.props;
if (file.mime_type === 'image/gif') {
return Client4.getFileUrl(file.id, this.state.timestamp);
}
return Client4.getFilePreviewUrl(file.id, this.state.timestamp);
};