about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2022-12-19 13:22:18 -0600
committerPaul Frazee <pfrazee@gmail.com>2022-12-19 13:22:18 -0600
commite99eb7bfad2fd3eeb7cfcec26e554580c73c4d7d (patch)
tree0390e8d02a5ae4af77622999dc49ce4f944cdaa1 /src
parentae3099dfca13f6651762f6ea9a3d2a14ebc99df4 (diff)
downloadvoidsky-e99eb7bfad2fd3eeb7cfcec26e554580c73c4d7d.tar.zst
Fix to thread ordering in the feed: correctly identify the starts of threads when adjacent
Diffstat (limited to 'src')
-rw-r--r--src/state/models/feed-view.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/state/models/feed-view.ts b/src/state/models/feed-view.ts
index f8080d4b5..dd4f9c69e 100644
--- a/src/state/models/feed-view.ts
+++ b/src/state/models/feed-view.ts
@@ -601,7 +601,11 @@ function preprocessFeed(feed: FeedItem[]): FeedItemWithThreadMeta[] {
     } else {
       if (!item._isThreadChild) {
         threadSlices.push({index: activeSlice, length: i - activeSlice})
-        activeSlice = -1
+        if (item._isThreadParent) {
+          activeSlice = i
+        } else {
+          activeSlice = -1
+        }
       }
     }
   }
@@ -630,7 +634,6 @@ function preprocessFeed(feed: FeedItem[]): FeedItemWithThreadMeta[] {
     if (slice.length > 3) {
       reorg.splice(slice.index - removedCount + 1, slice.length - 3)
       reorg[slice.index - removedCount]._isThreadChildElided = true
-      console.log(reorg[slice.index - removedCount])
       removedCount += slice.length - 3
     }
   }