From 3a61c3446a9f662c26dd0377d1fda806f76cc929 Mon Sep 17 00:00:00 2001 From: Hailey Date: Mon, 17 Jun 2024 00:33:19 -0700 Subject: [PATCH] revert --- src/view/screens/Home.tsx | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/view/screens/Home.tsx b/src/view/screens/Home.tsx index 333b648bea..bfcf7405e4 100644 --- a/src/view/screens/Home.tsx +++ b/src/view/screens/Home.tsx @@ -113,16 +113,15 @@ function HomeScreenReady({ const lastPagerReportedIndexRef = React.useRef(selectedIndex) React.useLayoutEffect(() => { let initialIndex = selectedIndex - console.log( - 'currentStarterPack.initialFeed', - currentStarterPack?.initialFeed, - ) if (currentStarterPack?.initialFeed) { if (currentStarterPack.initialFeed === 'following') { - initialIndex = 1 - } else if (allFeeds.length >= 3) { - initialIndex = 2 - } else if (initialIndex === -1) { + initialIndex = allFeeds.findIndex(f => f === 'following') + } else { + initialIndex = allFeeds.findIndex( + f => f === `feedgen|${currentStarterPack.initialFeed}`, + ) + } + if (initialIndex === -1) { initialIndex = 0 } setCurrentStarterPack(undefined) @@ -141,8 +140,8 @@ function HomeScreenReady({ }, [ selectedIndex, allFeeds, - currentStarterPack?.initialFeed, setCurrentStarterPack, + currentStarterPack?.initialFeed, ]) const {hasSession} = useSession()