Skip to content

Commit

Permalink
Fix error getting through by primary feed sort (#3562)
Browse files Browse the repository at this point in the history
  • Loading branch information
pfrazee authored Apr 16, 2024
1 parent f265d65 commit 68d002a
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/screens/Onboarding/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,21 +107,15 @@ async function whenFollowsIndexed(
}

/**
* Kinda hacky, but we want For Your or Discover to appear as the first pinned
* Kinda hacky, but we want Discover to appear as the first pinned
* feed after Following
*/
export function sortPrimaryAlgorithmFeeds(uris: string[]) {
return uris.sort((a, b) => {
if (a === PRIMARY_FEEDS[0].uri) {
if (a === PRIMARY_FEEDS[0]?.uri) {
return -1
}
if (b === PRIMARY_FEEDS[0].uri) {
return 1
}
if (a === PRIMARY_FEEDS[1].uri) {
return -1
}
if (b === PRIMARY_FEEDS[1].uri) {
if (b === PRIMARY_FEEDS[0]?.uri) {
return 1
}
return a.localeCompare(b)
Expand Down

0 comments on commit 68d002a

Please sign in to comment.