Filter out attachments with no url
This commit is contained in:
parent
e7d350a0e3
commit
91ea4577f1
|
@ -12,8 +12,10 @@ function renderAttachment(tags: string[][]) {
|
|||
const uuid = tags.find(([name]) => name === 'uuid')?.[1];
|
||||
const blurhash = tags.find(([name]) => name === 'blurhash')?.[1];
|
||||
|
||||
if (!url) return;
|
||||
|
||||
return {
|
||||
id: uuid,
|
||||
id: uuid ?? url,
|
||||
type: getAttachmentType(m ?? ''),
|
||||
url,
|
||||
preview_url: url,
|
||||
|
|
|
@ -106,7 +106,7 @@ async function renderStatus(event: DittoEvent, opts: RenderStatusOpts): Promise<
|
|||
pinned: Boolean(pinEvent),
|
||||
reblog: null,
|
||||
application: null,
|
||||
media_attachments: media.map(renderAttachment),
|
||||
media_attachments: media.map(renderAttachment).filter(Boolean),
|
||||
mentions,
|
||||
tags: [],
|
||||
emojis: renderEmojis(event),
|
||||
|
|
Loading…
Reference in New Issue