about summary refs log tree commit diff
path: root/src/state/models/feeds/posts.ts
diff options
context:
space:
mode:
authorEric Bailey <git@esb.lol>2023-08-24 18:26:29 -0500
committerGitHub <noreply@github.com>2023-08-24 16:26:29 -0700
commit4654a9a45e68eeba289f2f35473fb2af60e754e2 (patch)
tree344ded1d3ff63def5f64c00c3abcee4258fad12f /src/state/models/feeds/posts.ts
parenta5981e127f7e4e2a5ba44717b91b26161adc0a5e (diff)
downloadvoidsky-4654a9a45e68eeba289f2f35473fb2af60e754e2.tar.zst
defer loading of feeds until visible (#1271)
* defer loading of feeds until visible

* Fix: use existing hasLoaded

* Fix: dont query for latest during initial load

---------

Co-authored-by: Paul Frazee <pfrazee@gmail.com>
Diffstat (limited to 'src/state/models/feeds/posts.ts')
-rw-r--r--src/state/models/feeds/posts.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/state/models/feeds/posts.ts b/src/state/models/feeds/posts.ts
index 8bc75daa4..15145a203 100644
--- a/src/state/models/feeds/posts.ts
+++ b/src/state/models/feeds/posts.ts
@@ -272,7 +272,7 @@ export class PostsFeedModel {
    * Check if new posts are available
    */
   async checkForLatest() {
-    if (this.hasNewLatest || this.isLoading) {
+    if (!this.hasLoaded || this.hasNewLatest || this.isLoading) {
       return
     }
     const res = await this._getFeed({limit: 1})