tweak concat
tweak oops, concat. tweak filtering of suggested feeds
This commit is contained in:
@@ -41,12 +41,14 @@ export function StepFeeds({moderationOpts}: {moderationOpts: ModerationOpts}) {
|
|||||||
const {data: popularFeedsPages, fetchNextPage} = useGetPopularFeedsQuery({
|
const {data: popularFeedsPages, fetchNextPage} = useGetPopularFeedsQuery({
|
||||||
limit: 30,
|
limit: 30,
|
||||||
})
|
})
|
||||||
const popularFeeds =
|
const popularFeeds = popularFeedsPages?.pages.flatMap(p => p.feeds) ?? []
|
||||||
popularFeedsPages?.pages
|
|
||||||
.flatMap(page => page.feeds)
|
|
||||||
.filter(f => !savedFeeds?.some(sf => sf?.uri === f.uri)) ?? []
|
|
||||||
|
|
||||||
const suggestedFeeds = savedFeeds?.concat(popularFeeds)
|
const suggestedFeeds =
|
||||||
|
savedFeeds.length === 0
|
||||||
|
? popularFeeds
|
||||||
|
: savedFeeds.concat(
|
||||||
|
popularFeeds.filter(f => !savedFeeds.some(sf => sf.uri === f.uri)),
|
||||||
|
)
|
||||||
|
|
||||||
const {data: searchedFeeds, isLoading: isLoadingSearch} =
|
const {data: searchedFeeds, isLoading: isLoadingSearch} =
|
||||||
useSearchPopularFeedsQuery({q: throttledQuery})
|
useSearchPopularFeedsQuery({q: throttledQuery})
|
||||||
|
|||||||
Reference in New Issue
Block a user