about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2023-03-17 18:09:27 -0500
committerPaul Frazee <pfrazee@gmail.com>2023-03-17 18:09:27 -0500
commit025681c2f2c161325bac7fa7c435c580b947d6f4 (patch)
tree32664c597b0dcf95a2f50374fdb4344efac148fb /src
parentff39b072f3110f018edd6797ee642728f0dae259 (diff)
downloadvoidsky-025681c2f2c161325bac7fa7c435c580b947d6f4.tar.zst
Fall back to who to follow
Diffstat (limited to 'src')
-rw-r--r--src/state/models/discovery/foafs.ts12
-rw-r--r--src/view/screens/Search.tsx2
2 files changed, 13 insertions, 1 deletions
diff --git a/src/state/models/discovery/foafs.ts b/src/state/models/discovery/foafs.ts
index 4a46ae9de..241338a16 100644
--- a/src/state/models/discovery/foafs.ts
+++ b/src/state/models/discovery/foafs.ts
@@ -23,6 +23,18 @@ export class FoafsModel {
     makeAutoObservable(this)
   }
 
+  get hasContent() {
+    if (this.popular.length > 0) {
+      return true
+    }
+    for (const foaf of this.foafs.values()) {
+      if (foaf.follows.length) {
+        return true
+      }
+    }
+    return false
+  }
+
   fetch = bundleAsync(async () => {
     try {
       this.isLoading = true
diff --git a/src/view/screens/Search.tsx b/src/view/screens/Search.tsx
index 246aa13f5..6ae5fba0d 100644
--- a/src/view/screens/Search.tsx
+++ b/src/view/screens/Search.tsx
@@ -205,7 +205,7 @@ export const SearchScreen = withAuthRequired(
               }>
               {foafsView.isLoading ? (
                 <ProfileCardFeedLoadingPlaceholder />
-              ) : foafsView.sources.length ? (
+              ) : foafsView.hasContent ? (
                 <>
                   {foafsView.popular.length > 0 && (
                     <View style={styles.suggestions}>