mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-03-21 21:29:20 +01:00
Only show replies count if ancestors is a thread
This commit is contained in:
parent
8f45f2cb4d
commit
eebb55ba38
1 changed files with 6 additions and 1 deletions
|
@ -142,6 +142,9 @@ function StatusPage() {
|
||||||
skipThreading: true,
|
skipThreading: true,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
const ancestorsIsThread = ancestors.every(
|
||||||
|
(s) => s.account.id === heroStatus.account.id,
|
||||||
|
);
|
||||||
const nestedDescendants = [];
|
const nestedDescendants = [];
|
||||||
descendants.forEach((status) => {
|
descendants.forEach((status) => {
|
||||||
saveStatus(status, instance, {
|
saveStatus(status, instance, {
|
||||||
|
@ -184,6 +187,7 @@ function StatusPage() {
|
||||||
...ancestors.map((s) => ({
|
...ancestors.map((s) => ({
|
||||||
id: s.id,
|
id: s.id,
|
||||||
ancestor: true,
|
ancestor: true,
|
||||||
|
isThread: ancestorsIsThread,
|
||||||
accountID: s.account.id,
|
accountID: s.account.id,
|
||||||
repliesCount: s.repliesCount,
|
repliesCount: s.repliesCount,
|
||||||
})),
|
})),
|
||||||
|
@ -625,6 +629,7 @@ function StatusPage() {
|
||||||
const {
|
const {
|
||||||
id: statusID,
|
id: statusID,
|
||||||
ancestor,
|
ancestor,
|
||||||
|
isThread,
|
||||||
descendant,
|
descendant,
|
||||||
thread,
|
thread,
|
||||||
replies,
|
replies,
|
||||||
|
@ -731,7 +736,7 @@ function StatusPage() {
|
||||||
size={thread || ancestor ? 'm' : 's'}
|
size={thread || ancestor ? 'm' : 's'}
|
||||||
enableTranslate
|
enableTranslate
|
||||||
/>
|
/>
|
||||||
{ancestor && !!repliesCount && (
|
{ancestor && isThread && !!repliesCount && (
|
||||||
<div class="replies-link">
|
<div class="replies-link">
|
||||||
<Icon icon="comment" />{' '}
|
<Icon icon="comment" />{' '}
|
||||||
<span title={repliesCount}>
|
<span title={repliesCount}>
|
||||||
|
|
Loading…
Reference in a new issue