From 7a58c1f82e4ca32a43fd3592826eff3998ae3c84 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Mon, 9 Sep 2024 16:13:21 -0500 Subject: [PATCH 1/7] If fallback, return nothing --- src/state/queries/suggested-follows.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/state/queries/suggested-follows.ts b/src/state/queries/suggested-follows.ts index f5d51a974ae..23299eb531e 100644 --- a/src/state/queries/suggested-follows.ts +++ b/src/state/queries/suggested-follows.ts @@ -106,13 +106,13 @@ export function useSuggestedFollowsQuery(options?: SuggestedFollowsOptions) { export function useSuggestedFollowsByActorQuery({did}: {did: string}) { const agent = useAgent() return useQuery({ - gcTime: 0, + gcTime: 0, // TODO queryKey: suggestedFollowsByActorQueryKey(did), queryFn: async () => { const res = await agent.app.bsky.graph.getSuggestedFollowsByActor({ actor: did, }) - return res.data + return res.data.isFallback ? {suggestions: []} : res.data }, }) } From f9d54fb76c82045e36c08bc6504163c536dd56d0 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Thu, 12 Sep 2024 10:58:40 -0500 Subject: [PATCH 2/7] Compress size a bit --- src/components/FeedInterstitials.tsx | 45 ++++++++++++++-------------- src/components/ProfileCard.tsx | 4 ++- 2 files changed, 26 insertions(+), 23 deletions(-) diff --git a/src/components/FeedInterstitials.tsx b/src/components/FeedInterstitials.tsx index 5031f584e5f..158aef3a3b5 100644 --- a/src/components/FeedInterstitials.tsx +++ b/src/components/FeedInterstitials.tsx @@ -197,6 +197,7 @@ export function SuggestedFollowsProfile({did}: {did: string}) { isSuggestionsLoading={isSuggestionsLoading} profiles={data?.suggestions ?? []} error={error} + viewContext="profile" /> ) } @@ -220,10 +221,12 @@ export function ProfileGrid({ isSuggestionsLoading, error, profiles, + viewContext = 'feed', }: { isSuggestionsLoading: boolean profiles: AppBskyActorDefs.ProfileViewDetailed[] error: Error | null + viewContext?: 'profile' | 'feed' }) { const t = useTheme() const {_} = useLingui() @@ -280,7 +283,7 @@ export function ProfileGrid({ shape="round" /> - + )} @@ -297,33 +300,31 @@ export function ProfileGrid({ return ( - - - Suggested for you + + + {viewContext === 'profile' ? ( + Similar accounts + ) : ( + Suggested for you + )} - + {gtMobile ? ( - - + + {content} - + - + {content}