From 8a4a8af61c47ba315bcf39d6170825e316bfd241 Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Thu, 4 Jan 2024 17:34:10 -0800 Subject: [PATCH] New user home feed fixes (#2421) * Readd discover to default feeds for new users * Fallback just to discover in home when mergefeed is disabled * Always provide a cursor with mergefeed (no 'end of feed' condition) --- src/lib/api/feed/merge.ts | 2 +- src/lib/constants.ts | 4 ++-- src/view/screens/Home.tsx | 5 ++++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/lib/api/feed/merge.ts b/src/lib/api/feed/merge.ts index a4391afb..2314e2b9 100644 --- a/src/lib/api/feed/merge.ts +++ b/src/lib/api/feed/merge.ts @@ -98,7 +98,7 @@ export class MergeFeedAPI implements FeedAPI { } return { - cursor: posts.length ? String(this.itemCursor) : undefined, + cursor: String(this.itemCursor), feed: posts, } } diff --git a/src/lib/constants.ts b/src/lib/constants.ts index e566d40d..aec8338d 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -117,8 +117,8 @@ export async function DEFAULT_FEEDS( } else { // production return { - pinned: [], - saved: [], + pinned: [PROD_DEFAULT_FEED('whats-hot')], + saved: [PROD_DEFAULT_FEED('whats-hot')], } } } diff --git a/src/view/screens/Home.tsx b/src/view/screens/Home.tsx index b8033f0b..0e20a9cf 100644 --- a/src/view/screens/Home.tsx +++ b/src/view/screens/Home.tsx @@ -19,6 +19,7 @@ import {useSession} from '#/state/session' import {loadString, saveString} from '#/lib/storage' import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries' import {clamp} from '#/lib/numbers' +import {PROD_DEFAULT_FEED} from '#/lib/constants' type Props = NativeStackScreenProps export function HomeScreen(props: Props) { @@ -109,7 +110,9 @@ function HomeScreenReady({ const homeFeedParams = React.useMemo(() => { return { mergeFeedEnabled: Boolean(preferences.feedViewPrefs.lab_mergeFeedEnabled), - mergeFeedSources: preferences.feeds.saved, + mergeFeedSources: preferences.feedViewPrefs.lab_mergeFeedEnabled + ? preferences.feeds.saved + : [PROD_DEFAULT_FEED('whats-hot')], } }, [preferences])