diff options
Diffstat (limited to 'src/state/queries')
-rw-r--r-- | src/state/queries/post-thread.ts | 8 | ||||
-rw-r--r-- | src/state/queries/suggested-follows.ts | 7 |
2 files changed, 11 insertions, 4 deletions
diff --git a/src/state/queries/post-thread.ts b/src/state/queries/post-thread.ts index 83ca60c2a..a569cb160 100644 --- a/src/state/queries/post-thread.ts +++ b/src/state/queries/post-thread.ts @@ -408,10 +408,14 @@ export function* findAllPostsInQueryData( } } } - for (let post of findAllPostsInFeedQueryData(queryClient, uri)) { + for (let post of findAllPostsInNotifsQueryData(queryClient, uri)) { + // Check notifications first. If you have a post in notifications, + // it's often due to a like or a repost, and we want to prioritize + // a post object with >0 likes/reposts over a stale version with no + // metrics in order to avoid a notification->post scroll jump. yield postViewToPlaceholderThread(post) } - for (let post of findAllPostsInNotifsQueryData(queryClient, uri)) { + for (let post of findAllPostsInFeedQueryData(queryClient, uri)) { yield postViewToPlaceholderThread(post) } for (let post of findAllPostsInQuoteQueryData(queryClient, uri)) { 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 }, }) } |