mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-16 15:21:48 +03:00
Additional logic for auto-collapsing comments
This commit is contained in:
parent
c475308a2b
commit
9ac71920bf
1 changed files with 5 additions and 1 deletions
|
@ -986,6 +986,7 @@ function SubComments({
|
|||
instance,
|
||||
hasParentThread,
|
||||
level,
|
||||
previousOpen,
|
||||
}) {
|
||||
const [searchParams, setSearchParams] = useSearchParams();
|
||||
// Set isBrief = true:
|
||||
|
@ -1025,7 +1026,9 @@ function SubComments({
|
|||
.slice(0, 3);
|
||||
|
||||
const open =
|
||||
(!hasParentThread || replies.length === 1) && (isBrief || !hasManyStatuses);
|
||||
!previousOpen &&
|
||||
(!hasParentThread || replies.length === 1) &&
|
||||
(isBrief || !hasManyStatuses);
|
||||
const openBefore = cachedRepliesToggle[replies[0].id];
|
||||
|
||||
const handleMediaClick = useCallback((e, i, media, status) => {
|
||||
|
@ -1113,6 +1116,7 @@ function SubComments({
|
|||
hasManyStatuses={hasManyStatuses}
|
||||
replies={r.replies}
|
||||
level={level + 1}
|
||||
previousOpen={open}
|
||||
/>
|
||||
)}
|
||||
</li>
|
||||
|
|
Loading…
Add table
Reference in a new issue