From f3e1741629566200a2959a1706b740ef6a66d706 Mon Sep 17 00:00:00 2001 From: xmflsct Date: Sun, 1 Jan 2023 18:48:32 +0100 Subject: [PATCH] Update updateStatusProperty.ts --- .../queryHooks/timeline/updateStatusProperty.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/utils/queryHooks/timeline/updateStatusProperty.ts b/src/utils/queryHooks/timeline/updateStatusProperty.ts index da0b9ee4..a942360a 100644 --- a/src/utils/queryHooks/timeline/updateStatusProperty.ts +++ b/src/utils/queryHooks/timeline/updateStatusProperty.ts @@ -20,16 +20,20 @@ const updateStatusProperty = ({ return page } else { if (typeof (page.body as Mastodon.Conversation[])[0].unread === 'boolean') { - foundToot = (page.body as Mastodon.Conversation[]).find( - ({ last_status }) => last_status?.id === status.id + foundToot = (page.body as Mastodon.Conversation[]).find(({ last_status }) => + last_status?.reblog + ? last_status.reblog.id === status.id + : last_status?.id === status.id )?.last_status return page } else if (typeof (page.body as Mastodon.Notification[])[0].type === 'string') { - foundToot = (page.body as Mastodon.Notification[]).find( - no => no.status?.id === status.id + foundToot = (page.body as Mastodon.Notification[]).find(no => + no.status?.reblog ? no.status.reblog.id === status.id : no.status?.id === status.id )?.status } else { - foundToot = (page.body as Mastodon.Status[]).find(toot => toot.id === status.id) + foundToot = (page.body as Mastodon.Status[]).find(toot => + toot.reblog ? toot.reblog.id === status.id : toot.id === status.id + ) } return page