Skip to content

Commit

Permalink
Allow back navigation to home on profile header (#1717)
Browse files Browse the repository at this point in the history
Navigate back to home if there is no navigation history.
  • Loading branch information
pdelfan authored Oct 31, 2023
1 parent 97ce9a7 commit 21f7a2a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/view/com/profile/ProfileHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,11 @@ const ProfileHeaderLoaded = observer(function ProfileHeaderLoadedImpl({
const [showSuggestedFollows, setShowSuggestedFollows] = React.useState(false)

const onPressBack = React.useCallback(() => {
navigation.goBack()
if (navigation.canGoBack()) {
navigation.goBack()
} else {
navigation.navigate('Home')
}
}, [navigation])

const onPressAvi = React.useCallback(() => {
Expand Down

0 comments on commit 21f7a2a

Please sign in to comment.