remove unnecessary isLoading
This commit is contained in:
@@ -32,11 +32,8 @@ export function StepFeeds({moderationOpts}: {moderationOpts: ModerationOpts}) {
|
|||||||
const throttledQuery = useThrottledValue(query, 500)
|
const throttledQuery = useThrottledValue(query, 500)
|
||||||
const {screenReaderEnabled} = useA11y()
|
const {screenReaderEnabled} = useA11y()
|
||||||
|
|
||||||
const {
|
const {data: savedFeedsAndLists, isFetchedAfterMount: isFetchedSavedFeeds} =
|
||||||
data: savedFeedsAndLists,
|
useSavedFeeds()
|
||||||
isLoading: isLoadingSavedFeeds,
|
|
||||||
isFetchedAfterMount: isFetchedSavedFeeds,
|
|
||||||
} = useSavedFeeds()
|
|
||||||
const savedFeeds = savedFeedsAndLists?.feeds
|
const savedFeeds = savedFeedsAndLists?.feeds
|
||||||
.filter(f => f.type === 'feed' && f.view.uri !== DISCOVER_FEED_URI)
|
.filter(f => f.type === 'feed' && f.view.uri !== DISCOVER_FEED_URI)
|
||||||
.map(f => f.view) as AppBskyFeedDefs.GeneratorView[]
|
.map(f => f.view) as AppBskyFeedDefs.GeneratorView[]
|
||||||
@@ -50,7 +47,7 @@ export function StepFeeds({moderationOpts}: {moderationOpts: ModerationOpts}) {
|
|||||||
})
|
})
|
||||||
const popularFeeds = popularFeedsPages?.pages.flatMap(p => p.feeds) ?? []
|
const popularFeeds = popularFeedsPages?.pages.flatMap(p => p.feeds) ?? []
|
||||||
const suggestedFeeds =
|
const suggestedFeeds =
|
||||||
isFetchedSavedFeeds && !isLoadingSavedFeeds && !isLoadingPopularFeeds
|
isFetchedSavedFeeds && !isLoadingPopularFeeds
|
||||||
? savedFeeds.concat(
|
? savedFeeds.concat(
|
||||||
popularFeeds.filter(f => !savedFeeds.some(sf => sf.uri === f.uri)),
|
popularFeeds.filter(f => !savedFeeds.some(sf => sf.uri === f.uri)),
|
||||||
)
|
)
|
||||||
@@ -60,10 +57,7 @@ export function StepFeeds({moderationOpts}: {moderationOpts: ModerationOpts}) {
|
|||||||
useSearchPopularFeedsQuery({q: throttledQuery})
|
useSearchPopularFeedsQuery({q: throttledQuery})
|
||||||
|
|
||||||
const isLoading =
|
const isLoading =
|
||||||
!isFetchedSavedFeeds ||
|
!isFetchedSavedFeeds || isLoadingPopularFeeds || isFetchingSearchedFeeds
|
||||||
isLoadingSavedFeeds ||
|
|
||||||
isLoadingPopularFeeds ||
|
|
||||||
isFetchingSearchedFeeds
|
|
||||||
|
|
||||||
const renderItem = ({
|
const renderItem = ({
|
||||||
item,
|
item,
|
||||||
|
|||||||
Reference in New Issue
Block a user