Classify all images and videos as visual media
Even if we can’t play it back. Handle that in the lightbox. Also: Exclude voice messages.
This commit is contained in:
parent
787d023557
commit
20246c4d07
1 changed files with 5 additions and 4 deletions
|
@ -1,7 +1,6 @@
|
|||
import is from '@sindresorhus/is';
|
||||
import moment from 'moment';
|
||||
|
||||
import * as GoogleChrome from '../util/GoogleChrome';
|
||||
import * as MIME from './MIME';
|
||||
import { arrayBufferToObjectURL } from '../util/arrayBufferToObjectURL';
|
||||
import { saveURLAsFile } from '../util/saveURLAsFile';
|
||||
|
@ -35,9 +34,11 @@ export const isVisualMedia = (attachment: Attachment): boolean => {
|
|||
return false;
|
||||
}
|
||||
|
||||
const isSupportedImageType = GoogleChrome.isImageTypeSupported(contentType);
|
||||
const isSupportedVideoType = GoogleChrome.isVideoTypeSupported(contentType);
|
||||
return isSupportedImageType || isSupportedVideoType;
|
||||
if (isVoiceMessage(attachment)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return MIME.isImage(contentType) || MIME.isVideo(contentType);
|
||||
};
|
||||
|
||||
export const isVoiceMessage = (attachment: Attachment): boolean => {
|
||||
|
|
Loading…
Add table
Reference in a new issue