fix: always populate quote_id if possible

This commit is contained in:
P. Reis 2024-04-16 15:16:18 -03:00
parent e4892c3e4a
commit e19e41f826
1 changed files with 2 additions and 4 deletions

View File

@ -76,8 +76,6 @@ async function renderStatus(event: DittoEvent, opts: statusOpts): Promise<any> {
const media = [...mediaLinks, ...mediaTags]; const media = [...mediaLinks, ...mediaTags];
const quoteStatus = !event.quote_repost ? null : await renderStatus(event.quote_repost, { depth: depth + 1 });
return { return {
id: event.id, id: event.id,
account, account,
@ -105,8 +103,8 @@ async function renderStatus(event: DittoEvent, opts: statusOpts): Promise<any> {
tags: [], tags: [],
emojis: renderEmojis(event), emojis: renderEmojis(event),
poll: null, poll: null,
quote: quoteStatus, quote: !event.quote_repost ? null : await renderStatus(event.quote_repost, { depth: depth + 1 }),
quote_id: quoteStatus ? quoteStatus.id : null, quote_id: event.tags.find(([name]) => name === 'q')?.[1] ?? null,
uri: Conf.external(note), uri: Conf.external(note),
url: Conf.external(note), url: Conf.external(note),
zapped: Boolean(zapEvent), zapped: Boolean(zapEvent),