From d7d52bbdee7686c7e2e8d347ecb9557c881783fa Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Mon, 8 Apr 2024 15:53:08 +0000 Subject: [PATCH] Apply 1 suggestion(s) to 1 file(s) --- src/views/mastodon/statuses.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/views/mastodon/statuses.ts b/src/views/mastodon/statuses.ts index cac79ef..69b086f 100644 --- a/src/views/mastodon/statuses.ts +++ b/src/views/mastodon/statuses.ts @@ -101,12 +101,8 @@ async function renderStatus(event: DittoEvent, viewerPubkey?: string) { async function renderReblog(event: DittoEvent) { if (!event.author) return; - for (let i = 0; i < event.tags.length; i++) { - if (event.tags[i][0] === 'e') { - event.repost = await getEvent(event.tags[i][1], { kind: 1 }); - break; - } - } + const repostId = event.tags.find(([name]) => name === 'p')?.[1]; + event.repost = await getEvent(repostId, { kind: 1 }); if (!event.repost) return;