Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Wait for preferences before showing suggested feeds (#4618)

authored by

Hailey and committed by
GitHub
9e89ddeb bce3338a

+13 -5
+13 -5
src/screens/StarterPack/Wizard/StepFeeds.tsx
··· 32 32 const throttledQuery = useThrottledValue(query, 500) 33 33 const {screenReaderEnabled} = useA11y() 34 34 35 - const {data: savedFeedsAndLists, isLoading: isLoadingSavedFeeds} = 35 + const {data: savedFeedsAndLists, isFetchedAfterMount: isFetchedSavedFeeds} = 36 36 useSavedFeeds() 37 37 const savedFeeds = savedFeedsAndLists?.feeds 38 38 .filter(f => f.type === 'feed' && f.view.uri !== DISCOVER_FEED_URI) ··· 46 46 limit: 30, 47 47 }) 48 48 const popularFeeds = popularFeedsPages?.pages.flatMap(p => p.feeds) ?? [] 49 - const suggestedFeeds = savedFeeds.concat( 50 - popularFeeds.filter(f => !savedFeeds.some(sf => sf.uri === f.uri)), 51 - ) 49 + 50 + // If we have saved feeds already loaded, display them immediately 51 + // Then, when popular feeds have loaded we can concat them to the saved feeds 52 + const suggestedFeeds = 53 + savedFeeds || isFetchedSavedFeeds 54 + ? popularFeeds 55 + ? savedFeeds.concat( 56 + popularFeeds.filter(f => !savedFeeds.some(sf => sf.uri === f.uri)), 57 + ) 58 + : savedFeeds 59 + : undefined 52 60 53 61 const {data: searchedFeeds, isFetching: isFetchingSearchedFeeds} = 54 62 useSearchPopularFeedsQuery({q: throttledQuery}) 55 63 56 64 const isLoading = 57 - isLoadingSavedFeeds || isLoadingPopularFeeds || isFetchingSearchedFeeds 65 + !isFetchedSavedFeeds || isLoadingPopularFeeds || isFetchingSearchedFeeds 58 66 59 67 const renderItem = ({ 60 68 item,