about summary refs log tree commit diff
path: root/src/lib/api
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2023-12-07 16:30:04 -0800
committerGitHub <noreply@github.com>2023-12-07 16:30:04 -0800
commit040ce0321545c7b7588b96e26d988fc19ffbbba3 (patch)
tree37cce1c17873b00dfd9c5f0b19123f8ec29eda76 /src/lib/api
parent52a0cb8faccd0df8250b4b084005d2fd6d12a9ad (diff)
downloadvoidsky-040ce0321545c7b7588b96e26d988fc19ffbbba3.tar.zst
Grab-bag of post-feed improvements (#2140)
* Sanity check against cases where empty pages may occur

* Use the mergefeed as an emergency fallback to an empty feed

* Check for new posts on focus
Diffstat (limited to 'src/lib/api')
-rw-r--r--src/lib/api/feed/merge.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/api/feed/merge.ts b/src/lib/api/feed/merge.ts
index 11e963f0a..381159d18 100644
--- a/src/lib/api/feed/merge.ts
+++ b/src/lib/api/feed/merge.ts
@@ -29,7 +29,7 @@ export class MergeFeedAPI implements FeedAPI {
     this.feedCursor = 0
     this.itemCursor = 0
     this.sampleCursor = 0
-    if (this.params.mergeFeedEnabled && this.params.mergeFeedSources) {
+    if (this.params.mergeFeedSources) {
       this.customFeeds = shuffle(
         this.params.mergeFeedSources.map(
           feedUri => new MergeFeedSource_Custom(feedUri, this.feedTuners),
@@ -108,7 +108,10 @@ export class MergeFeedAPI implements FeedAPI {
 
     // this condition establishes the frequency that custom feeds are woven into follows
     const shouldSample =
-      i >= 15 && candidateFeeds.length >= 2 && (i % 4 === 0 || i % 5 === 0)
+      this.params.mergeFeedEnabled &&
+      i >= 15 &&
+      candidateFeeds.length >= 2 &&
+      (i % 4 === 0 || i % 5 === 0)
 
     if (!canSample && !hasFollows) {
       // no data available