RN-337 Enable GIF support in image preview (#928)
This commit is contained in:
parent
a5eecb9fb3
commit
9a5e7ac541
3 changed files with 6 additions and 2 deletions
|
|
@ -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}
|
||||
|
|
|
|||
|
|
@ -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) => {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue