Prefer GoogleChrome.is*
over MIME.is*
This commit is contained in:
parent
64c3d604aa
commit
b65370c8d7
4 changed files with 17 additions and 12 deletions
|
@ -2,6 +2,7 @@ import React from 'react';
|
|||
import classnames from 'classnames';
|
||||
|
||||
import * as MIME from '../../../ts/types/MIME';
|
||||
import * as GoogleChrome from '../../../ts/util/GoogleChrome';
|
||||
|
||||
|
||||
interface Props {
|
||||
|
@ -91,12 +92,12 @@ export class Quote extends React.Component<Props, {}> {
|
|||
const { contentType, thumbnail } = first;
|
||||
const objectUrl = getObjectUrl(thumbnail);
|
||||
|
||||
if (MIME.isVideo(contentType)) {
|
||||
if (GoogleChrome.isVideoTypeSupported(contentType)) {
|
||||
return objectUrl
|
||||
? this.renderImage(objectUrl, 'play')
|
||||
: this.renderIcon('movie');
|
||||
}
|
||||
if (MIME.isImage(contentType)) {
|
||||
if (GoogleChrome.isImageTypeSupported(contentType)) {
|
||||
return objectUrl
|
||||
? this.renderImage(objectUrl)
|
||||
: this.renderIcon('image');
|
||||
|
@ -122,10 +123,10 @@ export class Quote extends React.Component<Props, {}> {
|
|||
const first = attachments[0];
|
||||
const { contentType, fileName, isVoiceMessage } = first;
|
||||
|
||||
if (MIME.isVideo(contentType)) {
|
||||
if (GoogleChrome.isVideoTypeSupported(contentType)) {
|
||||
return <div className="type-label">{i18n('video')}</div>;
|
||||
}
|
||||
if (MIME.isImage(contentType)) {
|
||||
if (GoogleChrome.isImageTypeSupported(contentType)) {
|
||||
return <div className="type-label">{i18n('photo')}</div>;
|
||||
}
|
||||
if (MIME.isAudio(contentType) && isVoiceMessage) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue