ensure we get navigated away to starter pack when signed in (#4640)
* ensure we get navigated away to starter pack when signed in * cleanzio/stable
parent
e5b9f130a9
commit
d11b552710
|
@ -33,8 +33,25 @@ import {HomeHeader} from '../com/home/HomeHeader'
|
||||||
type Props = NativeStackScreenProps<HomeTabNavigatorParams, 'Home' | 'Start'>
|
type Props = NativeStackScreenProps<HomeTabNavigatorParams, 'Home' | 'Start'>
|
||||||
export function HomeScreen(props: Props) {
|
export function HomeScreen(props: Props) {
|
||||||
const {data: preferences} = usePreferencesQuery()
|
const {data: preferences} = usePreferencesQuery()
|
||||||
|
const {currentAccount} = useSession()
|
||||||
const {data: pinnedFeedInfos, isLoading: isPinnedFeedsLoading} =
|
const {data: pinnedFeedInfos, isLoading: isPinnedFeedsLoading} =
|
||||||
usePinnedFeedsInfos()
|
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) {
|
if (preferences && pinnedFeedInfos && !isPinnedFeedsLoading) {
|
||||||
return (
|
return (
|
||||||
<HomeScreenReady
|
<HomeScreenReady
|
||||||
|
|
Loading…
Reference in New Issue