about summary refs log tree commit diff
path: root/src/view/com/post-thread/PostThread.tsx
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2022-07-21 13:07:24 -0500
committerPaul Frazee <pfrazee@gmail.com>2022-07-21 13:07:24 -0500
commit28dbc5f5e614b3caf08d36a7edaaf19a0ee0f0bc (patch)
tree073a42ff18ee286ace5cf701f859d32842da684c /src/view/com/post-thread/PostThread.tsx
parent139c9deb75d54d72cc819f5308001ec66d3962bc (diff)
downloadvoidsky-28dbc5f5e614b3caf08d36a7edaaf19a0ee0f0bc.tar.zst
Add the ability to navigate to posts within a thread
Diffstat (limited to 'src/view/com/post-thread/PostThread.tsx')
-rw-r--r--src/view/com/post-thread/PostThread.tsx3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/view/com/post-thread/PostThread.tsx b/src/view/com/post-thread/PostThread.tsx
index 7bbad36be..9622ceb49 100644
--- a/src/view/com/post-thread/PostThread.tsx
+++ b/src/view/com/post-thread/PostThread.tsx
@@ -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) {