ui: media attachments before text (#23467)

* ui: media attachments before text

* fix prettier formatting
This commit is contained in:
Saba Fallah 2026-05-25 08:50:41 +02:00 committed by GitHub
parent 9627d0f540
commit b96487645c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 9 additions and 11 deletions

View file

@ -1 +1 @@
export const MEGAPIXELS_TO_PIXELS = 1_000_000;
export const MEGAPIXELS_TO_PIXELS = 1_000_000;

View file

@ -879,14 +879,6 @@ export class ChatService {
});
}
if (message.content) {
contentParts.push({
type: ContentPartType.TEXT,
text: message.content
});
}
// Include images from all messages
const imageFiles = message.extra.filter(
(extra: DatabaseMessageExtra): extra is DatabaseMessageExtraImageFile =>
extra.type === AttachmentType.IMAGE
@ -919,6 +911,13 @@ export class ChatService {
});
}
if (message.content) {
contentParts.push({
type: ContentPartType.TEXT,
text: message.content
});
}
const videoFiles = message.extra.filter(
(extra: DatabaseMessageExtra): extra is DatabaseMessageExtraVideoFile =>
extra.type === AttachmentType.VIDEO

View file

@ -14,9 +14,8 @@ export function capImageDataURLSize(
): Promise<string> {
return new Promise((resolve, reject) => {
try {
const mimeMatch = base64UrlImage.match(BASE64_IMAGE_URI_REGEX);
if (!mimeMatch) {
return reject(new Error('Invalid data URL format.'));
}