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