diff --git a/src/view/shell/desktop/LeftNav.tsx b/src/view/shell/desktop/LeftNav.tsx index 17d078dc..621c7926 100644 --- a/src/view/shell/desktop/LeftNav.tsx +++ b/src/view/shell/desktop/LeftNav.tsx @@ -86,6 +86,7 @@ interface NavItemProps { const NavItem = observer( ({count, href, icon, iconFilled, label}: NavItemProps) => { const pal = usePalette('default') + const store = useStores() const [pathName] = React.useMemo(() => router.matchPath(href), [href]) const currentRouteName = useNavigationState(state => { if (!state) { @@ -96,12 +97,23 @@ const NavItem = observer( const isCurrent = isTab(currentRouteName, pathName) const {onPress} = useLinkProps({to: href}) + const onPressWrapped = React.useCallback( + (e: React.MouseEvent) => { + e.preventDefault() + if (isCurrent) { + store.emitScreenSoftReset() + } else { + onPress() + } + }, + [onPress, isCurrent, store], + ) return ( @@ -113,7 +125,11 @@ const NavItem = observer( ) : null} - + {label}