85 lines
2.5 KiB
Diff
85 lines
2.5 KiB
Diff
diff --git a/src/view/screens/Feeds.tsx b/src/view/screens/Feeds.tsx
|
|
--- a/src/view/screens/Feeds.tsx
|
|
+++ b/src/view/screens/Feeds.tsx
|
|
@@ -288,80 +288,7 @@ export function FeedsScreen(_props: Props) {
|
|
}
|
|
}
|
|
|
|
- if (!hasSession || (hasSession && canShowDiscoverSection)) {
|
|
- slices.push({
|
|
- key: 'popularFeedsHeader',
|
|
- type: 'popularFeedsHeader',
|
|
- })
|
|
|
|
- if (popularFeedsError || searchError) {
|
|
- slices.push({
|
|
- key: 'popularFeedsError',
|
|
- type: 'error',
|
|
- error: cleanError(
|
|
- popularFeedsError?.toString() ?? searchError?.toString() ?? '',
|
|
- ),
|
|
- })
|
|
- } else {
|
|
- if (isUserSearching) {
|
|
- if (isSearchPending || !searchResults) {
|
|
- slices.push({
|
|
- key: 'popularFeedsLoading',
|
|
- type: 'popularFeedsLoading',
|
|
- })
|
|
- } else {
|
|
- if (!searchResults || searchResults?.length === 0) {
|
|
- slices.push({
|
|
- key: 'popularFeedsNoResults',
|
|
- type: 'popularFeedsNoResults',
|
|
- })
|
|
- } else {
|
|
- slices = slices.concat(
|
|
- searchResults.map(feed => ({
|
|
- key: `popularFeed:${feed.uri}`,
|
|
- type: 'popularFeed',
|
|
- feedUri: feed.uri,
|
|
- feed,
|
|
- })),
|
|
- )
|
|
- }
|
|
- }
|
|
- } else {
|
|
- if (isPopularFeedsFetching && !popularFeeds?.pages) {
|
|
- slices.push({
|
|
- key: 'popularFeedsLoading',
|
|
- type: 'popularFeedsLoading',
|
|
- })
|
|
- } else {
|
|
- if (!popularFeeds?.pages) {
|
|
- slices.push({
|
|
- key: 'popularFeedsNoResults',
|
|
- type: 'popularFeedsNoResults',
|
|
- })
|
|
- } else {
|
|
- for (const page of popularFeeds.pages || []) {
|
|
- slices = slices.concat(
|
|
- page.feeds.map(feed => ({
|
|
- key: `popularFeed:${feed.uri}`,
|
|
- type: 'popularFeed',
|
|
- feedUri: feed.uri,
|
|
- feed,
|
|
- })),
|
|
- )
|
|
- }
|
|
-
|
|
- if (isPopularFeedsFetchingNextPage) {
|
|
- slices.push({
|
|
- key: 'popularFeedsLoadingMore',
|
|
- type: 'popularFeedsLoadingMore',
|
|
- })
|
|
- }
|
|
- }
|
|
- }
|
|
- }
|
|
- }
|
|
- }
|
|
-
|
|
return slices
|
|
}, [
|
|
hasSession,
|