diff --git a/src/components/FeedInterstitials.tsx b/src/components/FeedInterstitials.tsx
index 5031f584e5..286ded13e2 100644
--- a/src/components/FeedInterstitials.tsx
+++ b/src/components/FeedInterstitials.tsx
@@ -60,16 +60,13 @@ function CardOuter({
export function SuggestedFollowPlaceholder() {
const t = useTheme()
return (
-
+
-
-
-
-
+
-
+
)
}
@@ -176,9 +173,14 @@ function useExperimentalSuggestedUsersQuery() {
}
export function SuggestedFollows({feed}: {feed: FeedDescriptor}) {
- const [feedType, feedUri] = feed.split('|')
+ const {currentAccount} = useSession()
+ const [feedType, feedUriOrDid] = feed.split('|')
if (feedType === 'author') {
- return
+ if (currentAccount?.did === feedUriOrDid) {
+ return null
+ } else {
+ return
+ }
} else {
return
}
@@ -197,6 +199,7 @@ export function SuggestedFollowsProfile({did}: {did: string}) {
isSuggestionsLoading={isSuggestionsLoading}
profiles={data?.suggestions ?? []}
error={error}
+ viewContext="profile"
/>
)
}
@@ -212,6 +215,7 @@ export function SuggestedFollowsHome() {
isSuggestionsLoading={isSuggestionsLoading}
profiles={profiles}
error={error}
+ viewContext="feed"
/>
)
}
@@ -220,10 +224,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 +286,7 @@ export function ProfileGrid({
shape="round"
/>
-
+
)}
@@ -297,33 +303,31 @@ export function ProfileGrid({
return (
-
-
- Suggested for you
+
+
+ {viewContext === 'profile' ? (
+ Similar accounts
+ ) : (
+ Suggested for you
+ )}
-
+
{gtMobile ? (
-
-
+
+
{content}
-
+
-
+
{content}
)
}
-export function DescriptionPlaceholder() {
+export function DescriptionPlaceholder({
+ numberOfLines = 3,
+}: {
+ numberOfLines?: number
+}) {
const t = useTheme()
return (
-
-
-
-
+
+ {Array(numberOfLines)
+ .fill(0)
+ .map((_, i) => (
+
+ ))}
)
}
diff --git a/src/state/queries/suggested-follows.ts b/src/state/queries/suggested-follows.ts
index f5d51a974a..5ae8317047 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({
- 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
},
})
}