ensure we get navigated away to starter pack when signed in (#4640)

* ensure we get navigated away to starter pack when signed in

* clean
zio/stable
Hailey 2024-06-25 09:36:54 -07:00 committed by GitHub
parent e5b9f130a9
commit d11b552710
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 17 additions and 0 deletions

View File

@ -33,8 +33,25 @@ import {HomeHeader} from '../com/home/HomeHeader'
type Props = NativeStackScreenProps<HomeTabNavigatorParams, 'Home' | 'Start'>
export function HomeScreen(props: Props) {
const {data: preferences} = usePreferencesQuery()
const {currentAccount} = useSession()
const {data: pinnedFeedInfos, isLoading: isPinnedFeedsLoading} =
usePinnedFeedsInfos()
React.useEffect(() => {
const params = props.route.params
if (
currentAccount &&
props.route.name === 'Start' &&
params?.name &&
params?.rkey
) {
props.navigation.navigate('StarterPack', {
rkey: params.rkey,
name: params.name,
})
}
}, [currentAccount, props.navigation, props.route.name, props.route.params])
if (preferences && pinnedFeedInfos && !isPinnedFeedsLoading) {
return (
<HomeScreenReady