diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-11-29 17:37:15 -0800 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2023-11-29 17:37:15 -0800 |
commit | 1140b05b835d8487b24d4b83ad932f46fa00c2d9 (patch) | |
tree | 567382e9515aedfb84440767a6d9fbab6a2d1bbb | |
parent | 4c7b9652dbe858d5357d4e983c110c84c9e5a46e (diff) | |
download | voidsky-1140b05b835d8487b24d4b83ad932f46fa00c2d9.tar.zst |
Slightly less verbose variable
-rw-r--r-- | src/state/queries/feed.ts | 6 | ||||
-rw-r--r-- | src/view/com/pager/FeedsTabBar.web.tsx | 4 | ||||
-rw-r--r-- | src/view/com/pager/FeedsTabBarMobile.tsx | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/src/state/queries/feed.ts b/src/state/queries/feed.ts index 3266b0f6b..a73e64e8a 100644 --- a/src/state/queries/feed.ts +++ b/src/state/queries/feed.ts @@ -248,7 +248,7 @@ const FOLLOWING_FEED_STUB: FeedSourceInfo = { export function usePinnedFeedsInfos(): { feeds: FeedSourceInfo[] - hasPinnedCustomFeedOrList: boolean + hasPinnedCustom: boolean } { const queryClient = useQueryClient() const [tabs, setTabs] = React.useState<FeedSourceInfo[]>([ @@ -256,7 +256,7 @@ export function usePinnedFeedsInfos(): { ]) const {data: preferences} = usePreferencesQuery() - const hasPinnedCustomFeedOrList = React.useMemo<boolean>(() => { + const hasPinnedCustom = React.useMemo<boolean>(() => { return tabs.some(tab => tab !== FOLLOWING_FEED_STUB) }, [tabs]) @@ -307,5 +307,5 @@ export function usePinnedFeedsInfos(): { fetchFeedInfo() }, [queryClient, setTabs, preferences?.feeds?.pinned]) - return {feeds: tabs, hasPinnedCustomFeedOrList} + return {feeds: tabs, hasPinnedCustom} } diff --git a/src/view/com/pager/FeedsTabBar.web.tsx b/src/view/com/pager/FeedsTabBar.web.tsx index 2445d4523..57c83f17c 100644 --- a/src/view/com/pager/FeedsTabBar.web.tsx +++ b/src/view/com/pager/FeedsTabBar.web.tsx @@ -82,14 +82,14 @@ function FeedsTabBarPublic() { function FeedsTabBarTablet( props: RenderTabBarFnProps & {testID?: string; onPressSelected: () => void}, ) { - const {feeds, hasPinnedCustomFeedOrList} = usePinnedFeedsInfos() + const {feeds, hasPinnedCustom} = usePinnedFeedsInfos() const pal = usePalette('default') const {hasSession} = useSession() const navigation = useNavigation<NavigationProp>() const {headerMinimalShellTransform} = useMinimalShellMode() const {headerHeight} = useShellLayout() const pinnedDisplayNames = hasSession ? feeds.map(f => f.displayName) : [] - const showFeedsLinkInTabBar = hasSession && !hasPinnedCustomFeedOrList + const showFeedsLinkInTabBar = hasSession && !hasPinnedCustom const items = showFeedsLinkInTabBar ? pinnedDisplayNames.concat('Feeds ✨') : pinnedDisplayNames diff --git a/src/view/com/pager/FeedsTabBarMobile.tsx b/src/view/com/pager/FeedsTabBarMobile.tsx index fc9eb8f14..882b6cfc5 100644 --- a/src/view/com/pager/FeedsTabBarMobile.tsx +++ b/src/view/com/pager/FeedsTabBarMobile.tsx @@ -30,12 +30,12 @@ export function FeedsTabBar( const {_} = useLingui() const setDrawerOpen = useSetDrawerOpen() const navigation = useNavigation<NavigationProp>() - const {feeds, hasPinnedCustomFeedOrList} = usePinnedFeedsInfos() + const {feeds, hasPinnedCustom} = usePinnedFeedsInfos() const brandBlue = useColorSchemeStyle(s.brandBlue, s.blue3) const {headerHeight} = useShellLayout() const {headerMinimalShellTransform} = useMinimalShellMode() const pinnedDisplayNames = hasSession ? feeds.map(f => f.displayName) : [] - const showFeedsLinkInTabBar = hasSession && !hasPinnedCustomFeedOrList + const showFeedsLinkInTabBar = hasSession && !hasPinnedCustom const items = showFeedsLinkInTabBar ? pinnedDisplayNames.concat('Feeds ✨') : pinnedDisplayNames |