about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/screens/StarterPack/Wizard/StepFeeds.tsx18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/screens/StarterPack/Wizard/StepFeeds.tsx b/src/screens/StarterPack/Wizard/StepFeeds.tsx
index 5170edc6e..878d17ce0 100644
--- a/src/screens/StarterPack/Wizard/StepFeeds.tsx
+++ b/src/screens/StarterPack/Wizard/StepFeeds.tsx
@@ -32,7 +32,7 @@ export function StepFeeds({moderationOpts}: {moderationOpts: ModerationOpts}) {
   const throttledQuery = useThrottledValue(query, 500)
   const {screenReaderEnabled} = useA11y()
 
-  const {data: savedFeedsAndLists, isLoading: isLoadingSavedFeeds} =
+  const {data: savedFeedsAndLists, isFetchedAfterMount: isFetchedSavedFeeds} =
     useSavedFeeds()
   const savedFeeds = savedFeedsAndLists?.feeds
     .filter(f => f.type === 'feed' && f.view.uri !== DISCOVER_FEED_URI)
@@ -46,15 +46,23 @@ export function StepFeeds({moderationOpts}: {moderationOpts: ModerationOpts}) {
     limit: 30,
   })
   const popularFeeds = popularFeedsPages?.pages.flatMap(p => p.feeds) ?? []
-  const suggestedFeeds = savedFeeds.concat(
-    popularFeeds.filter(f => !savedFeeds.some(sf => sf.uri === f.uri)),
-  )
+
+  // If we have saved feeds already loaded, display them immediately
+  // Then, when popular feeds have loaded we can concat them to the saved feeds
+  const suggestedFeeds =
+    savedFeeds || isFetchedSavedFeeds
+      ? popularFeeds
+        ? savedFeeds.concat(
+            popularFeeds.filter(f => !savedFeeds.some(sf => sf.uri === f.uri)),
+          )
+        : savedFeeds
+      : undefined
 
   const {data: searchedFeeds, isFetching: isFetchingSearchedFeeds} =
     useSearchPopularFeedsQuery({q: throttledQuery})
 
   const isLoading =
-    isLoadingSavedFeeds || isLoadingPopularFeeds || isFetchingSearchedFeeds
+    !isFetchedSavedFeeds || isLoadingPopularFeeds || isFetchingSearchedFeeds
 
   const renderItem = ({
     item,