fix caption for attachments not displayed once sent

pull/1874/head
audric 4 years ago
parent de1475b3bb
commit 7b93d5df9a

@ -688,6 +688,7 @@ export class MessageModel extends Backbone.Model<MessageAttributes> {
screenshot, screenshot,
thumbnail, thumbnail,
fileName, fileName,
caption,
} = attachment; } = attachment;
const isVoiceMessage = const isVoiceMessage =
@ -696,6 +697,7 @@ export class MessageModel extends Backbone.Model<MessageAttributes> {
return { return {
id, id,
contentType, contentType,
caption,
size: size || 0, size: size || 0,
width: width || 0, width: width || 0,
height: height || 0, height: height || 0,

@ -136,6 +136,7 @@ export type PropsForSearchResults = {
export type PropsForAttachment = { export type PropsForAttachment = {
id: number; id: number;
contentType: string; contentType: string;
caption?: string;
size: number; size: number;
width?: number; width?: number;
height?: number; height?: number;

@ -109,6 +109,7 @@ export async function getFile(attachment: StagedAttachmentType, maxMeasurements?
const scaled = await autoScale(attachment, maxMeasurements); const scaled = await autoScale(attachment, maxMeasurements);
const fileRead = await readFile(scaled); const fileRead = await readFile(scaled);
return { return {
caption: attachment.caption,
...fileRead, ...fileRead,
url: undefined, url: undefined,
flags: attachmentFlags || null, flags: attachmentFlags || null,

Loading…
Cancel
Save