diff options
author | Minseo Lee <itoupluk427@gmail.com> | 2024-03-13 10:30:07 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-13 10:30:07 +0900 |
commit | 3ead08ab2649533583c300904bbd85c250292014 (patch) | |
tree | 48366b4d1d847eb59f0187520d2c5fb4150bba3c /src/view/shell | |
parent | 2456ca828fc4ba05a085fa03c6f7c37b3edcd45e (diff) | |
parent | 653240bc056236489e8a7882b7b6f902ed0885c2 (diff) | |
download | voidsky-3ead08ab2649533583c300904bbd85c250292014.tar.zst |
Merge branch 'bluesky-social:main' into patch-3
Diffstat (limited to 'src/view/shell')
-rw-r--r-- | src/view/shell/bottom-bar/BottomBar.tsx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/view/shell/bottom-bar/BottomBar.tsx b/src/view/shell/bottom-bar/BottomBar.tsx index 1ab3334fa..115faa296 100644 --- a/src/view/shell/bottom-bar/BottomBar.tsx +++ b/src/view/shell/bottom-bar/BottomBar.tsx @@ -36,6 +36,7 @@ import {Button} from '#/view/com/util/forms/Button' import {s} from 'lib/styles' import {Logo} from '#/view/icons/Logo' import {Logotype} from '#/view/icons/Logotype' +import {useDedupe} from 'lib/hooks/useDedupe' type TabOptions = 'Home' | 'Search' | 'Notifications' | 'MyProfile' | 'Feeds' @@ -54,6 +55,7 @@ export function BottomBar({navigation}: BottomTabBarProps) { const {data: profile} = useProfileQuery({did: currentAccount?.did}) const {requestSwitchToAccount} = useLoggedOutViewControls() const closeAllActiveElements = useCloseAllActiveElements() + const dedupe = useDedupe() const showSignIn = React.useCallback(() => { closeAllActiveElements() @@ -74,12 +76,12 @@ export function BottomBar({navigation}: BottomTabBarProps) { if (tabState === TabState.InsideAtRoot) { emitSoftReset() } else if (tabState === TabState.Inside) { - navigation.dispatch(StackActions.popToTop()) + dedupe(() => navigation.dispatch(StackActions.popToTop())) } else { - navigation.navigate(`${tab}Tab`) + dedupe(() => navigation.navigate(`${tab}Tab`)) } }, - [track, navigation], + [track, navigation, dedupe], ) const onPressHome = React.useCallback(() => onPressTab('Home'), [onPressTab]) const onPressSearch = React.useCallback( |