From 45cce90298de61e713bb9b734a94fc97afa4967f Mon Sep 17 00:00:00 2001 From: Gabi Purcaru Date: Wed, 21 Dec 2022 09:20:26 +0000 Subject: [PATCH] modified FAQ and added error when there are no results found --- components/Content.tsx | 15 ++++++++++++++- components/FAQ.tsx | 11 ++++++++--- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/components/Content.tsx b/components/Content.tsx index 8b39c16..b4c8d84 100644 --- a/components/Content.tsx +++ b/components/Content.tsx @@ -144,6 +144,8 @@ export function Content({ }) { return; } setLoading(true); + setDone(false); + setFollows([]); setDomain(getDomain(handle)); await accountFofs(handle, setProgress, setFollows); setLoading(false); @@ -205,11 +207,22 @@ export function Content({ }) { {isLoading ?

Loaded {numLoaded} of {totalToLoad}...

: null} + {isDone && follows.length === 0 ? +
+ + Info +
+ No results found. Please double check for typos in the handle, and ensure that you follow at least a few people + to seed the search. Otherwise, try again later as Mastodon may throttle requests. +
+
+ : null} + - {isDone || follows.length > 0 ? + {isDone && follows.length > 0 ?
diff --git a/components/FAQ.tsx b/components/FAQ.tsx index 29e2ffb..75650e3 100644 --- a/components/FAQ.tsx +++ b/components/FAQ.tsx @@ -21,8 +21,13 @@ export function FAQ({ }) { - This tool only works if your list of follows is public. If you've opted to hide your social graph, you will not see - any results here. + There could be a few reasons: +
    +
  • This tool only works if your list of follows is public. If you've opted to hide your social graph, you will not see + any results here.
  • +
  • Due to the high volume of requests, sometimes Mastodon throttles this tool. If that's the case, try again a bit later.
  • +
  • Make sure you have no typos in the Mastodon handle, and make sure you follow at least a few people to seed the search.
  • +
@@ -38,7 +43,7 @@ export function FAQ({ }) { ; } -function FAQItem({ defaultSelected, title, children }: { defaultSelected?: boolean, title: string, children: React.ReactNode}) { +function FAQItem({ defaultSelected, title, children }: { defaultSelected?: boolean, title: string, children: React.ReactNode }) { const [selected, setSelected] = useState(defaultSelected); return (<>