Allow back navigation to home on profile header (#1717)

Navigate back to home if there is no navigation history.
zio/stable
Pouria Delfanazari 2023-10-30 19:23:41 -07:00 committed by GitHub
parent 97ce9a73d2
commit 21f7a2a247
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -119,7 +119,11 @@ const ProfileHeaderLoaded = observer(function ProfileHeaderLoadedImpl({
const [showSuggestedFollows, setShowSuggestedFollows] = React.useState(false)
const onPressBack = React.useCallback(() => {
if (navigation.canGoBack()) {
navigation.goBack()
} else {
navigation.navigate('Home')
}
}, [navigation])
const onPressAvi = React.useCallback(() => {