Add the ability to navigate to posts within a thread

This commit is contained in:
Paul Frazee 2022-07-21 13:07:24 -05:00
parent 139c9deb75
commit 28dbc5f5e6
7 changed files with 46 additions and 20 deletions

View file

@ -78,6 +78,9 @@ export const PostThread = observer(function PostThread({
function* flattenThread(
post: PostThreadViewPostModel,
): Generator<PostThreadViewPostModel, void> {
if (post.parent) {
yield* flattenThread(post.parent)
}
yield post
if (post.replies?.length) {
for (const reply of post.replies) {