From bdabfa9d38ab776b5bc7eedafecd11c396dd451b Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Tue, 28 Nov 2023 10:44:25 -0600 Subject: [PATCH] Guard against following tab stub being used un-authed (#2013) --- src/view/com/pager/FeedsTabBar.web.tsx | 3 ++- src/view/com/pager/FeedsTabBarMobile.tsx | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/view/com/pager/FeedsTabBar.web.tsx b/src/view/com/pager/FeedsTabBar.web.tsx index a39499b2..fdb4df17 100644 --- a/src/view/com/pager/FeedsTabBar.web.tsx +++ b/src/view/com/pager/FeedsTabBar.web.tsx @@ -81,9 +81,10 @@ function FeedsTabBarTablet( ) { const feeds = usePinnedFeedsInfos() const pal = usePalette('default') + const {hasSession} = useSession() const {headerMinimalShellTransform} = useMinimalShellMode() const {headerHeight} = useShellLayout() - const items = feeds.map(f => f.displayName) + const items = hasSession ? feeds.map(f => f.displayName) : [] return ( // @ts-ignore the type signature for transform wrong here, translateX and translateY need to be in separate objects -prf diff --git a/src/view/com/pager/FeedsTabBarMobile.tsx b/src/view/com/pager/FeedsTabBarMobile.tsx index 2983a457..735aa1ba 100644 --- a/src/view/com/pager/FeedsTabBarMobile.tsx +++ b/src/view/com/pager/FeedsTabBarMobile.tsx @@ -30,7 +30,7 @@ export function FeedsTabBar( const brandBlue = useColorSchemeStyle(s.brandBlue, s.blue3) const {headerHeight} = useShellLayout() const {headerMinimalShellTransform} = useMinimalShellMode() - const items = feeds.map(f => f.displayName) + const items = hasSession ? feeds.map(f => f.displayName) : [] const onPressAvi = React.useCallback(() => { setDrawerOpen(true)