about summary refs log tree commit diff
path: root/src/state/models/feeds/posts.ts
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2023-08-16 10:00:22 -0700
committerGitHub <noreply@github.com>2023-08-16 10:00:22 -0700
commit884e5c92944a4d53c7e0d2847eabd576b080b4ae (patch)
tree2846291e017cd24657f1c84e4a219caa481b3a88 /src/state/models/feeds/posts.ts
parentb0282865faf3d2576c0145281905b098c71a5e7b (diff)
downloadvoidsky-884e5c92944a4d53c7e0d2847eabd576b080b4ae.tar.zst
Fix to "Load new posts" showing sometimes when there's nothing new to show (#1191)
* Fix to feed item react key value (hopefully)

* Fix false-firing of load more (close #1028)
Diffstat (limited to 'src/state/models/feeds/posts.ts')
-rw-r--r--src/state/models/feeds/posts.ts11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/state/models/feeds/posts.ts b/src/state/models/feeds/posts.ts
index 52717953b..6facc27ad 100644
--- a/src/state/models/feeds/posts.ts
+++ b/src/state/models/feeds/posts.ts
@@ -263,7 +263,16 @@ export class PostsFeedModel {
       return
     }
     const res = await this._getFeed({limit: 1})
-    this.setHasNewLatest(res.data.feed[0]?.post.uri !== this.pollCursor)
+    if (res.data.feed[0]) {
+      const slices = this.tuner.tune(res.data.feed, this.feedTuners)
+      if (slices[0]) {
+        const sliceModel = new PostsFeedSliceModel(this.rootStore, slices[0])
+        if (sliceModel.moderation.content.filter) {
+          return
+        }
+        this.setHasNewLatest(sliceModel.uri !== this.pollCursor)
+      }
+    }
   }
 
   /**