Draft attachments: Show image as generic attachment if too big
This commit is contained in:
@@ -10,6 +10,7 @@ import type { LocalizerType } from '../../types/Util';
|
|||||||
import type { AttachmentDraftType } from '../../types/Attachment';
|
import type { AttachmentDraftType } from '../../types/Attachment';
|
||||||
import {
|
import {
|
||||||
areAllAttachmentsVisual,
|
areAllAttachmentsVisual,
|
||||||
|
canDisplayImage,
|
||||||
isImageAttachment,
|
isImageAttachment,
|
||||||
isVideoAttachment,
|
isVideoAttachment,
|
||||||
} from '../../types/Attachment';
|
} from '../../types/Attachment';
|
||||||
@@ -74,7 +75,11 @@ export const AttachmentList = ({
|
|||||||
const isVideo = isVideoAttachment(attachment);
|
const isVideo = isVideoAttachment(attachment);
|
||||||
const closeAttachment = () => onCloseAttachment(attachment);
|
const closeAttachment = () => onCloseAttachment(attachment);
|
||||||
|
|
||||||
if (isImage || isVideo || attachment.pending) {
|
if (
|
||||||
|
(isImage && canDisplayImage([attachment])) ||
|
||||||
|
isVideo ||
|
||||||
|
attachment.pending
|
||||||
|
) {
|
||||||
const isDownloaded = !attachment.pending;
|
const isDownloaded = !attachment.pending;
|
||||||
const imageUrl =
|
const imageUrl =
|
||||||
url || (isVideo ? BLANK_VIDEO_THUMBNAIL : undefined);
|
url || (isVideo ? BLANK_VIDEO_THUMBNAIL : undefined);
|
||||||
|
Reference in New Issue
Block a user