diff options
author | Pouria Delfanazari <pdelfan@gmail.com> | 2023-10-30 19:23:41 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-30 19:23:41 -0700 |
commit | 21f7a2a247e8270df36fe20a8bb68e4bf558561c (patch) | |
tree | cab10c562f6d7c89df854c5db6d7e2fe572128df | |
parent | 97ce9a73d2ce0c088dbf3e95d1e3bc3d20aa410d (diff) | |
download | voidsky-21f7a2a247e8270df36fe20a8bb68e4bf558561c.tar.zst |
Allow back navigation to home on profile header (#1717)
Navigate back to home if there is no navigation history.
-rw-r--r-- | src/view/com/profile/ProfileHeader.tsx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/view/com/profile/ProfileHeader.tsx b/src/view/com/profile/ProfileHeader.tsx index 5514bf98e..6bb3bc5f6 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(() => { |