diff options
author | Eric Bailey <git@esb.lol> | 2025-04-08 17:08:09 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-08 17:08:09 -0500 |
commit | c8568e3004831e76b29e0f710805cb4f1cfc7576 (patch) | |
tree | b09a3d51996a9ed6924520d150786a4b16aeb98f /src/state/queries/feed.ts | |
parent | 09111ef272f04bbd6a1d7e43f072fdde06133669 (diff) | |
download | voidsky-c8568e3004831e76b29e0f710805cb4f1cfc7576.tar.zst |
[Explore] Reduced experience (#8160)
* Only show suggested users for non-english users * Fall back to searching for users for non-english speakers * Disable other queries if full experience is disabled * Bump package * If no content langs, use full exp
Diffstat (limited to 'src/state/queries/feed.ts')
-rw-r--r-- | src/state/queries/feed.ts | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/state/queries/feed.ts b/src/state/queries/feed.ts index 5571c0949..89023e513 100644 --- a/src/state/queries/feed.ts +++ b/src/state/queries/feed.ts @@ -1,18 +1,18 @@ import {useCallback, useEffect, useMemo, useRef} from 'react' import { - AppBskyActorDefs, - AppBskyFeedDefs, - AppBskyGraphDefs, - AppBskyUnspeccedGetPopularFeedGenerators, + type AppBskyActorDefs, + type AppBskyFeedDefs, + type AppBskyGraphDefs, + type AppBskyUnspeccedGetPopularFeedGenerators, AtUri, moderateFeedGenerator, RichText, } from '@atproto/api' import { - InfiniteData, + type InfiniteData, keepPreviousData, - QueryClient, - QueryKey, + type QueryClient, + type QueryKey, useInfiniteQuery, useMutation, useQuery, @@ -28,7 +28,7 @@ import {usePreferencesQuery} from '#/state/queries/preferences' import {useAgent, useSession} from '#/state/session' import {router} from '#/routes' import {useModerationOpts} from '../preferences/moderation-opts' -import {FeedDescriptor} from './post-feed' +import {type FeedDescriptor} from './post-feed' import {precacheResolvedUri} from './resolve-uri' export type FeedSourceFeedInfo = { @@ -203,12 +203,12 @@ export const KNOWN_AUTHED_ONLY_FEEDS = [ 'at://did:plc:vpkhqolt662uhesyj6nxm7ys/app.bsky.feed.generator/followpics', // the gram, by why ] -type GetPopularFeedsOptions = {limit?: number} +type GetPopularFeedsOptions = {limit?: number; enabled?: boolean} export function createGetPopularFeedsQueryKey( options?: GetPopularFeedsOptions, ) { - return ['getPopularFeeds', options] + return ['getPopularFeeds', options?.limit] } export function useGetPopularFeedsQuery(options?: GetPopularFeedsOptions) { @@ -237,7 +237,7 @@ export function useGetPopularFeedsQuery(options?: GetPopularFeedsOptions) { QueryKey, string | undefined >({ - enabled: Boolean(moderationOpts), + enabled: Boolean(moderationOpts) && options?.enabled !== false, queryKey: createGetPopularFeedsQueryKey(options), queryFn: async ({pageParam}) => { const res = await agent.app.bsky.unspecced.getPopularFeedGenerators({ |