adjust feeds limit
This commit is contained in:
@@ -25,7 +25,9 @@ export function StepFeeds() {
|
|||||||
const [state, dispatch] = useWizardState()
|
const [state, dispatch] = useWizardState()
|
||||||
const [query, setQuery] = useState('')
|
const [query, setQuery] = useState('')
|
||||||
|
|
||||||
const {data: popularFeedsPages, fetchNextPage} = useGetPopularFeedsQuery()
|
const {data: popularFeedsPages, fetchNextPage} = useGetPopularFeedsQuery({
|
||||||
|
limit: 30,
|
||||||
|
})
|
||||||
|
|
||||||
const popularFeeds =
|
const popularFeeds =
|
||||||
popularFeedsPages?.pages.flatMap(page => page.feeds) || []
|
popularFeedsPages?.pages.flatMap(page => page.feeds) || []
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ export function useFeedSourceInfoQuery({uri}: {uri: string}) {
|
|||||||
|
|
||||||
export const useGetPopularFeedsQueryKey = ['getPopularFeeds']
|
export const useGetPopularFeedsQueryKey = ['getPopularFeeds']
|
||||||
|
|
||||||
export function useGetPopularFeedsQuery() {
|
export function useGetPopularFeedsQuery({limit = 10}: {limit?: number}) {
|
||||||
const agent = useAgent()
|
const agent = useAgent()
|
||||||
return useInfiniteQuery<
|
return useInfiniteQuery<
|
||||||
AppBskyUnspeccedGetPopularFeedGenerators.OutputSchema,
|
AppBskyUnspeccedGetPopularFeedGenerators.OutputSchema,
|
||||||
@@ -185,7 +185,7 @@ export function useGetPopularFeedsQuery() {
|
|||||||
queryKey: useGetPopularFeedsQueryKey,
|
queryKey: useGetPopularFeedsQueryKey,
|
||||||
queryFn: async ({pageParam}) => {
|
queryFn: async ({pageParam}) => {
|
||||||
const res = await agent.app.bsky.unspecced.getPopularFeedGenerators({
|
const res = await agent.app.bsky.unspecced.getPopularFeedGenerators({
|
||||||
limit: 10,
|
limit,
|
||||||
cursor: pageParam,
|
cursor: pageParam,
|
||||||
})
|
})
|
||||||
return res.data
|
return res.data
|
||||||
|
|||||||
Reference in New Issue
Block a user