Skip to content

Commit

Permalink
ensure we get navigated away to starter pack when signed in (#4640)
Browse files Browse the repository at this point in the history
* ensure we get navigated away to starter pack when signed in

* clean
  • Loading branch information
haileyok authored Jun 25, 2024
1 parent e5b9f13 commit d11b552
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/view/screens/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d11b552

Please sign in to comment.