Fix some threads suddenly lost inReplyToAccountId half-way

This commit is contained in:
Lim Chee Aun 2023-04-17 21:43:26 +08:00
parent 5f263d3658
commit 4fce94e8e7

View file

@ -251,6 +251,13 @@ function StatusThread({ closeLink = '/' }) {
} else if (status.inReplyToId === heroStatus.id) { } else if (status.inReplyToId === heroStatus.id) {
// If replying to the hero status, it's a reply, level 1 // If replying to the hero status, it's a reply, level 1
nestedDescendants.push(status); nestedDescendants.push(status);
} else if (
!status.inReplyToAccountId &&
nestedDescendants.find((s) => s.id === status.inReplyToId) &&
status.account.id === heroStatus.account.id
) {
// If replying to hero's own statuses, it's part of the thread, level 1
nestedDescendants.push(status);
} else { } else {
// If replying to someone else, it's a reply to a reply, level 2 // If replying to someone else, it's a reply to a reply, level 2
const parent = descendants.find((s) => s.id === status.inReplyToId); const parent = descendants.find((s) => s.id === status.inReplyToId);