Only show replies count if ancestors is a thread

pull/97/head
Lim Chee Aun 2023-04-08 19:47:54 +08:00
rodzic 8f45f2cb4d
commit eebb55ba38
1 zmienionych plików z 6 dodań i 1 usunięć

Wyświetl plik

@ -142,6 +142,9 @@ function StatusPage() {
skipThreading: true,
});
});
const ancestorsIsThread = ancestors.every(
(s) => s.account.id === heroStatus.account.id,
);
const nestedDescendants = [];
descendants.forEach((status) => {
saveStatus(status, instance, {
@ -184,6 +187,7 @@ function StatusPage() {
...ancestors.map((s) => ({
id: s.id,
ancestor: true,
isThread: ancestorsIsThread,
accountID: s.account.id,
repliesCount: s.repliesCount,
})),
@ -625,6 +629,7 @@ function StatusPage() {
const {
id: statusID,
ancestor,
isThread,
descendant,
thread,
replies,
@ -731,7 +736,7 @@ function StatusPage() {
size={thread || ancestor ? 'm' : 's'}
enableTranslate
/>
{ancestor && !!repliesCount && (
{ancestor && isThread && !!repliesCount && (
<div class="replies-link">
<Icon icon="comment" />{' '}
<span title={repliesCount}>