From 21f7a2a247e8270df36fe20a8bb68e4bf558561c Mon Sep 17 00:00:00 2001 From: Pouria Delfanazari Date: Mon, 30 Oct 2023 19:23:41 -0700 Subject: [PATCH] Allow back navigation to home on profile header (#1717) Navigate back to home if there is no navigation history. --- src/view/com/profile/ProfileHeader.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/view/com/profile/ProfileHeader.tsx b/src/view/com/profile/ProfileHeader.tsx index 5514bf98..6bb3bc5f 100644 --- a/src/view/com/profile/ProfileHeader.tsx +++ b/src/view/com/profile/ProfileHeader.tsx @@ -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(() => {