getQuoteAttachment: Handle attachments with no path
This commit is contained in:
parent
ec0c4861a7
commit
5f82c82803
1 changed files with 20 additions and 20 deletions
|
@ -80,12 +80,11 @@ export async function getQuoteAttachment(
|
|||
return {
|
||||
contentType: isGIFQuote ? IMAGE_GIF : contentType,
|
||||
fileName,
|
||||
thumbnail: thumbnail
|
||||
thumbnail:
|
||||
thumbnail && thumbnail.path
|
||||
? {
|
||||
...(await loadAttachmentData(thumbnail)),
|
||||
objectUrl: thumbnail.path
|
||||
? getLocalAttachmentUrl(thumbnail)
|
||||
: undefined,
|
||||
objectUrl: getLocalAttachmentUrl(thumbnail),
|
||||
}
|
||||
: undefined,
|
||||
};
|
||||
|
@ -103,12 +102,11 @@ export async function getQuoteAttachment(
|
|||
|
||||
return {
|
||||
contentType,
|
||||
thumbnail: image
|
||||
thumbnail:
|
||||
image && image.path
|
||||
? {
|
||||
...(await loadAttachmentData(image)),
|
||||
objectUrl: image.path
|
||||
? getLocalAttachmentUrl(image)
|
||||
: undefined,
|
||||
objectUrl: getLocalAttachmentUrl(image),
|
||||
}
|
||||
: undefined,
|
||||
};
|
||||
|
@ -122,10 +120,12 @@ export async function getQuoteAttachment(
|
|||
return [
|
||||
{
|
||||
contentType,
|
||||
thumbnail: {
|
||||
thumbnail: path
|
||||
? {
|
||||
...(await loadAttachmentData(sticker.data)),
|
||||
objectUrl: path ? getLocalAttachmentUrl(sticker.data) : undefined,
|
||||
},
|
||||
objectUrl: getLocalAttachmentUrl(sticker.data),
|
||||
}
|
||||
: undefined,
|
||||
},
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue