Remove todo, fix pwi view
This commit is contained in:
@@ -224,7 +224,7 @@ const HOME_FEED_STUB: FeedSourceInfo = {
|
|||||||
const DISCOVER_FEED_STUB: FeedSourceInfo = {
|
const DISCOVER_FEED_STUB: FeedSourceInfo = {
|
||||||
type: 'feed',
|
type: 'feed',
|
||||||
displayName: 'Discover',
|
displayName: 'Discover',
|
||||||
uri: DISCOVER_FEED_URI, // TODO may not want this
|
uri: DISCOVER_FEED_URI,
|
||||||
route: {
|
route: {
|
||||||
href: '/',
|
href: '/',
|
||||||
name: 'Home',
|
name: 'Home',
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import {useNavigation} from '@react-navigation/native'
|
|||||||
|
|
||||||
import {usePalette} from '#/lib/hooks/usePalette'
|
import {usePalette} from '#/lib/hooks/usePalette'
|
||||||
import {FeedSourceInfo} from '#/state/queries/feed'
|
import {FeedSourceInfo} from '#/state/queries/feed'
|
||||||
|
import {useSession} from '#/state/session'
|
||||||
import {NavigationProp} from 'lib/routes/types'
|
import {NavigationProp} from 'lib/routes/types'
|
||||||
import {isWeb} from 'platform/detection'
|
import {isWeb} from 'platform/detection'
|
||||||
import {RenderTabBarFnProps} from 'view/com/pager/Pager'
|
import {RenderTabBarFnProps} from 'view/com/pager/Pager'
|
||||||
@@ -17,14 +18,16 @@ export function HomeHeader(
|
|||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
const {feeds} = props
|
const {feeds} = props
|
||||||
|
const {hasSession} = useSession()
|
||||||
const navigation = useNavigation<NavigationProp>()
|
const navigation = useNavigation<NavigationProp>()
|
||||||
const pal = usePalette('default')
|
const pal = usePalette('default')
|
||||||
|
|
||||||
const hasPinnedCustom = React.useMemo<boolean>(() => {
|
const hasPinnedCustom = React.useMemo<boolean>(() => {
|
||||||
|
if (!hasSession) return false
|
||||||
return feeds.some(
|
return feeds.some(
|
||||||
tab => !['home', 'home-algo', 'following'].includes(tab.uri),
|
tab => !['home', 'home-algo', 'following'].includes(tab.uri),
|
||||||
)
|
)
|
||||||
}, [feeds])
|
}, [feeds, hasSession])
|
||||||
|
|
||||||
const items = React.useMemo(() => {
|
const items = React.useMemo(() => {
|
||||||
const pinnedNames = feeds.map(f => f.displayName)
|
const pinnedNames = feeds.map(f => f.displayName)
|
||||||
|
|||||||
Reference in New Issue
Block a user