Skip to content

Commit

Permalink
Don't collapse posts if not in tree view
Browse files Browse the repository at this point in the history
  • Loading branch information
vcarl committed Jan 19, 2025
1 parent 2781f58 commit 95922eb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/view/com/post-thread/PostThread.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ const keyExtractor = (item: RowItem) => {
return item._reactKey
}

const NO_OP = () => {}

export function PostThread({uri}: {uri: string | undefined}) {
const {hasSession, currentAccount} = useSession()
const {_} = useLingui()
Expand Down Expand Up @@ -511,7 +513,7 @@ export function PostThread({uri}: {uri: string | undefined}) {
<PostThreadItem
isCollapsed={collapsedCIDs.has(item.post.cid)}
isUnderCollapsed={descendantsOfCollapsedCIDs.has(item.post.cid)}
onCollapse={toggleCollapse}
onCollapse={treeView ? toggleCollapse : NO_OP}
post={item.post}
record={item.record}
threadgateRecord={threadgateRecord ?? undefined}
Expand Down
2 changes: 1 addition & 1 deletion src/view/com/post-thread/PostThreadItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ let PostThreadItemLoaded = ({
record,
richText,
moderation,
treeView = true,
treeView,
depth,
prevPost,
nextPost,
Expand Down

0 comments on commit 95922eb

Please sign in to comment.