about summary refs log tree commit diff
path: root/src/state/queries
diff options
context:
space:
mode:
authorEric Bailey <git@esb.lol>2024-09-12 16:34:10 -0500
committerGitHub <noreply@github.com>2024-09-12 22:34:10 +0100
commitd60a8f26c4fd14b7dc8274b7b6b0a70da7fa6859 (patch)
tree3d95d265929a22c1923ca8f1a55810fa20b33481 /src/state/queries
parent47bea320619b5854a56029c04ea001b9bbb19ccd (diff)
downloadvoidsky-d60a8f26c4fd14b7dc8274b7b6b0a70da7fa6859.tar.zst
Suggested follows by actor (on profiles) updates (#5243)
* If fallback, return nothing

* Compress size a bit

* Hide on own profile

* Match load state

* Remove gcTime

* Filter out followed users

* Feedback
Diffstat (limited to 'src/state/queries')
-rw-r--r--src/state/queries/suggested-follows.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/state/queries/suggested-follows.ts b/src/state/queries/suggested-follows.ts
index f5d51a974..5ae831704 100644
--- a/src/state/queries/suggested-follows.ts
+++ b/src/state/queries/suggested-follows.ts
@@ -106,13 +106,16 @@ export function useSuggestedFollowsQuery(options?: SuggestedFollowsOptions) {
 export function useSuggestedFollowsByActorQuery({did}: {did: string}) {
   const agent = useAgent()
   return useQuery<AppBskyGraphGetSuggestedFollowsByActor.OutputSchema, Error>({
-    gcTime: 0,
     queryKey: suggestedFollowsByActorQueryKey(did),
     queryFn: async () => {
       const res = await agent.app.bsky.graph.getSuggestedFollowsByActor({
         actor: did,
       })
-      return res.data
+      const data = res.data.isFallback ? {suggestions: []} : res.data
+      data.suggestions = data.suggestions.filter(profile => {
+        return !profile.viewer?.following
+      })
+      return data
     },
   })
 }