mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-03-14 04:08:32 +03:00
Don't open sub comments is parent is a thread
This commit is contained in:
parent
8ca4d7333e
commit
f6897ef4d8
1 changed files with 3 additions and 2 deletions
|
@ -667,6 +667,7 @@ function StatusPage() {
|
|||
instance={instance}
|
||||
hasManyStatuses={hasManyStatuses}
|
||||
replies={replies}
|
||||
hasParentThread={thread}
|
||||
/>
|
||||
)}
|
||||
{uiState === 'loading' &&
|
||||
|
@ -746,7 +747,7 @@ function StatusPage() {
|
|||
);
|
||||
}
|
||||
|
||||
function SubComments({ hasManyStatuses, replies, instance }) {
|
||||
function SubComments({ hasManyStatuses, replies, instance, hasParentThread }) {
|
||||
// Set isBrief = true:
|
||||
// - if less than or 2 replies
|
||||
// - if replies have no sub-replies
|
||||
|
@ -783,7 +784,7 @@ function SubComments({ hasManyStatuses, replies, instance }) {
|
|||
.filter((a, i, arr) => arr.findIndex((b) => b.id === a.id) === i)
|
||||
.slice(0, 3);
|
||||
|
||||
const open = isBrief || !hasManyStatuses;
|
||||
const open = !hasParentThread && (isBrief || !hasManyStatuses);
|
||||
|
||||
return (
|
||||
<details class="replies" open={open}>
|
||||
|
|
Loading…
Add table
Reference in a new issue