1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

Update updateStatusProperty.ts

This commit is contained in:
xmflsct
2023-01-01 18:48:32 +01:00
parent 2705b4b804
commit f3e1741629

View File

@ -20,16 +20,20 @@ const updateStatusProperty = ({
return page return page
} else { } else {
if (typeof (page.body as Mastodon.Conversation[])[0].unread === 'boolean') { if (typeof (page.body as Mastodon.Conversation[])[0].unread === 'boolean') {
foundToot = (page.body as Mastodon.Conversation[]).find( foundToot = (page.body as Mastodon.Conversation[]).find(({ last_status }) =>
({ last_status }) => last_status?.id === status.id last_status?.reblog
? last_status.reblog.id === status.id
: last_status?.id === status.id
)?.last_status )?.last_status
return page return page
} else if (typeof (page.body as Mastodon.Notification[])[0].type === 'string') { } else if (typeof (page.body as Mastodon.Notification[])[0].type === 'string') {
foundToot = (page.body as Mastodon.Notification[]).find( foundToot = (page.body as Mastodon.Notification[]).find(no =>
no => no.status?.id === status.id no.status?.reblog ? no.status.reblog.id === status.id : no.status?.id === status.id
)?.status )?.status
} else { } 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 return page