about summary refs log tree commit diff
path: root/src/lib/api/feed-manip.ts
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2023-03-21 13:26:13 -0500
committerPaul Frazee <pfrazee@gmail.com>2023-03-21 13:26:13 -0500
commitb692f2977322d27e646d8f3872a85543b3dbc69a (patch)
tree8149058e50aed82027d42a4b3985ec9a93eef1ef /src/lib/api/feed-manip.ts
parent35fae5ab252a4150004239ef8c0ba13e9fff4a87 (diff)
downloadvoidsky-b692f2977322d27e646d8f3872a85543b3dbc69a.tar.zst
Raise the bar a bit more for showing replies in the feed
Diffstat (limited to 'src/lib/api/feed-manip.ts')
-rw-r--r--src/lib/api/feed-manip.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/api/feed-manip.ts b/src/lib/api/feed-manip.ts
index d40e13a59..f6b54a175 100644
--- a/src/lib/api/feed-manip.ts
+++ b/src/lib/api/feed-manip.ts
@@ -28,6 +28,7 @@ export class FeedViewPostsSlice {
   get isThread() {
     return (
       this.items.length > 1 &&
+      !this.items[0].reply &&
       this.items.every(
         item => item.post.author.did === this.items[0].post.author.did,
       )
@@ -35,7 +36,7 @@ export class FeedViewPostsSlice {
   }
 
   get isReply() {
-    return this.items.length === 2 && !this.isThread
+    return this.items.length > 1 && !this.isThread
   }
 
   get rootItem() {
@@ -180,14 +181,14 @@ export class FeedTuner {
   }
 
   static likedRepliesOnly(tuner: FeedTuner, slices: FeedViewPostsSlice[]) {
-    // remove any replies without any likes
+    // remove any replies without at least 2 likes
     for (let i = slices.length - 1; i >= 0; i--) {
       if (slices[i].isThread) {
         continue
       }
       const item = slices[i].rootItem
       const isRepost = Boolean(item.reason)
-      if (item.reply && !isRepost && item.post.upvoteCount === 0) {
+      if (item.reply && !isRepost && item.post.upvoteCount < 2) {
         slices.splice(i, 1)
       }
     }