diff options
author | Paul Frazee <pfrazee@gmail.com> | 2022-12-18 18:54:05 -0600 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2022-12-18 18:54:05 -0600 |
commit | ae3099dfca13f6651762f6ea9a3d2a14ebc99df4 (patch) | |
tree | c78136d8fb2f15da0c1be3bef8d0e732287d050f /src/view/com/post-thread/PostThread.tsx | |
parent | 69b86255c6c2275b3403ce6654b17e0a2c56ced6 (diff) | |
download | voidsky-ae3099dfca13f6651762f6ea9a3d2a14ebc99df4.tar.zst |
Improve thread rendering
Diffstat (limited to 'src/view/com/post-thread/PostThread.tsx')
-rw-r--r-- | src/view/com/post-thread/PostThread.tsx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/view/com/post-thread/PostThread.tsx b/src/view/com/post-thread/PostThread.tsx index bbaa4efa2..0df505a74 100644 --- a/src/view/com/post-thread/PostThread.tsx +++ b/src/view/com/post-thread/PostThread.tsx @@ -90,14 +90,17 @@ export const PostThread = observer(function PostThread({ function* flattenThread( post: PostThreadViewPostModel, + isAscending = false, ): Generator<PostThreadViewPostModel, void> { if (post.parent) { - yield* flattenThread(post.parent) + yield* flattenThread(post.parent, true) } yield post if (post.replies?.length) { for (const reply of post.replies) { yield* flattenThread(reply) } + } else if (!isAscending && !post.parent && post.replyCount > 0) { + post._hasMore = true } } |