diff options
author | dan <dan.abramov@gmail.com> | 2024-08-08 15:49:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-08 15:49:34 +0100 |
commit | 2174feed441459448668934015810fe0eb876dde (patch) | |
tree | 6e77a24911816b5d139164755e71388dec8c6ebc /src/state/queries/profile.ts | |
parent | f1031d100b583fa289e654c5dfba6d251ea85272 (diff) | |
download | voidsky-2174feed441459448668934015810fe0eb876dde.tar.zst |
Include follow-based suggestions in interstitial (#4889)
Diffstat (limited to 'src/state/queries/profile.ts')
-rw-r--r-- | src/state/queries/profile.ts | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/state/queries/profile.ts b/src/state/queries/profile.ts index 1f866d26d..6682cf3c8 100644 --- a/src/state/queries/profile.ts +++ b/src/state/queries/profile.ts @@ -222,6 +222,7 @@ export function useProfileFollowMutationQueue( logContext: LogEvents['profile:follow']['logContext'] & LogEvents['profile:unfollow']['logContext'], ) { + const agent = useAgent() const queryClient = useQueryClient() const did = profile.did const initialFollowingUri = profile.viewer?.following @@ -253,6 +254,20 @@ export function useProfileFollowMutationQueue( updateProfileShadow(queryClient, did, { followingUri: finalFollowingUri, }) + + if (finalFollowingUri) { + agent.app.bsky.graph + .getSuggestedFollowsByActor({ + actor: did, + }) + .then(res => { + const dids = res.data.suggestions + .filter(a => !a.viewer?.following) + .map(a => a.did) + .slice(0, 8) + userActionHistory.followSuggestion(dids) + }) + } }, }) |