Skip to content

A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.

TypeScript fluxerfluxerapp

fix(app): put jxl and other image attachments in the mosaic (#2902)

Hampus82b2f4ec5ea5
diff --git a/fluxer_app/src/features/channel/components/MessageAttachmentUtils.ts b/fluxer_app/src/features/channel/components/MessageAttachmentUtils.ts
index f699a5385..fba7e747e 100644
--- a/fluxer_app/src/features/channel/components/MessageAttachmentUtils.ts
+++ b/fluxer_app/src/features/channel/components/MessageAttachmentUtils.ts
@@ -4,15 +4,12 @@ import type {MessageAttachment} from '@fluxer/schema/src/domains/message/Message
export const ATTACHMENT_CARD_WIDTH = 400;
-const IMAGE_TYPES = ['image/png', 'image/jpeg', 'image/jpg', 'image/gif', 'image/webp', 'image/avif'];
-const VIDEO_TYPES = ['video/mp4', 'video/webm', 'video/quicktime'];
-
function isImageType(contentType?: string): boolean {
- return contentType ? IMAGE_TYPES.includes(contentType) : false;
+ return contentType?.startsWith('image/') ?? false;
}
function isVideoType(contentType?: string): boolean {
- return contentType ? VIDEO_TYPES.includes(contentType) : false;
+ return contentType?.startsWith('video/') ?? false;
}
const hasRenderableDimensions = (attachment: MessageAttachment): boolean =>