Skip to content

Commit

Permalink
New user home feed fixes (#2421)
Browse files Browse the repository at this point in the history
* 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)
  • Loading branch information
pfrazee authored Jan 5, 2024
1 parent 3481762 commit 8a4a8af
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/lib/api/feed/merge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export class MergeFeedAPI implements FeedAPI {
}

return {
cursor: posts.length ? String(this.itemCursor) : undefined,
cursor: String(this.itemCursor),
feed: posts,
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')],
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion src/view/screens/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<HomeTabNavigatorParams, 'Home'>
export function HomeScreen(props: Props) {
Expand Down Expand Up @@ -109,7 +110,9 @@ function HomeScreenReady({
const homeFeedParams = React.useMemo<FeedParams>(() => {
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])

Expand Down

0 comments on commit 8a4a8af

Please sign in to comment.