mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-29 12:53:35 +01:00
Normalize message attachments
This commit is contained in:
@@ -913,6 +913,7 @@ export function MixedContentTypes(args: Props): JSX.Element {
|
||||
screenshot: {
|
||||
height: 112,
|
||||
width: 112,
|
||||
size: 128000,
|
||||
url: '/fixtures/kitten-4-112-112.jpg',
|
||||
contentType: IMAGE_JPEG,
|
||||
path: 'originalpath',
|
||||
|
||||
@@ -244,7 +244,7 @@ ImageOnly.args = {
|
||||
width: 100,
|
||||
size: 100,
|
||||
path: pngUrl,
|
||||
objectUrl: pngUrl,
|
||||
url: pngUrl,
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -261,7 +261,7 @@ ImageAttachment.args = {
|
||||
width: 100,
|
||||
size: 100,
|
||||
path: pngUrl,
|
||||
objectUrl: pngUrl,
|
||||
url: pngUrl,
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -331,7 +331,7 @@ VideoOnly.args = {
|
||||
width: 100,
|
||||
size: 100,
|
||||
path: pngUrl,
|
||||
objectUrl: pngUrl,
|
||||
url: pngUrl,
|
||||
},
|
||||
},
|
||||
text: undefined,
|
||||
@@ -349,7 +349,7 @@ VideoAttachment.args = {
|
||||
width: 100,
|
||||
size: 100,
|
||||
path: pngUrl,
|
||||
objectUrl: pngUrl,
|
||||
url: pngUrl,
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -588,7 +588,7 @@ IsStoryReplyEmoji.args = {
|
||||
width: 100,
|
||||
size: 100,
|
||||
path: pngUrl,
|
||||
objectUrl: pngUrl,
|
||||
url: pngUrl,
|
||||
},
|
||||
},
|
||||
reactionEmoji: '🏋️',
|
||||
|
||||
@@ -33,7 +33,10 @@ import type { QuotedAttachmentType } from '../../model-types';
|
||||
|
||||
const EMPTY_OBJECT = Object.freeze(Object.create(null));
|
||||
|
||||
export type QuotedAttachmentForUIType = QuotedAttachmentType &
|
||||
export type QuotedAttachmentForUIType = Pick<
|
||||
QuotedAttachmentType,
|
||||
'contentType' | 'thumbnail' | 'fileName'
|
||||
> &
|
||||
Pick<AttachmentType, 'isVoiceMessage' | 'fileName' | 'textAttachment'>;
|
||||
|
||||
export type Props = {
|
||||
@@ -101,7 +104,7 @@ function getUrl(thumbnail?: ThumbnailType): string | undefined {
|
||||
return;
|
||||
}
|
||||
|
||||
return thumbnail.objectUrl || thumbnail.url;
|
||||
return thumbnail.url;
|
||||
}
|
||||
|
||||
function getTypeLabel({
|
||||
|
||||
Reference in New Issue
Block a user