From 7816be7bec74766ab24ee51683210c66664a6ad7 Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Fri, 17 Mar 2023 18:09:27 -0500 Subject: [PATCH] Fall back to who to follow --- src/state/models/discovery/foafs.ts | 12 ++++++++++++ src/view/screens/Search.tsx | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/state/models/discovery/foafs.ts b/src/state/models/discovery/foafs.ts index 4a46ae9de3..241338a16c 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 246aa13f57..6ae5fba0d6 100644 --- a/src/view/screens/Search.tsx +++ b/src/view/screens/Search.tsx @@ -205,7 +205,7 @@ export const SearchScreen = withAuthRequired( }> {foafsView.isLoading ? ( - ) : foafsView.sources.length ? ( + ) : foafsView.hasContent ? ( <> {foafsView.popular.length > 0 && (