diff --git a/src/lib/routes/helpers.ts b/src/lib/routes/helpers.ts index 07407a1a3b..33e7563a3c 100644 --- a/src/lib/routes/helpers.ts +++ b/src/lib/routes/helpers.ts @@ -46,7 +46,11 @@ export function isTab(current: string, route: string) { // our tab routes can be variously referenced by 3 different names // this helper deals with that weirdness // -prf - return current.startsWith(route) + return ( + current === route || + current === `${route}Tab` || + current === `${route}Inner` + ) } export enum TabState { diff --git a/src/view/shell/desktop/LeftNav.tsx b/src/view/shell/desktop/LeftNav.tsx index b8b1136180..d9358ca136 100644 --- a/src/view/shell/desktop/LeftNav.tsx +++ b/src/view/shell/desktop/LeftNav.tsx @@ -306,6 +306,7 @@ function SwitcherMenuProfileLink() { return isTab(currentRouteInfo.name, pathName) } }, [currentAccount?.handle, currentRouteInfo, pathName]) + const onProfilePress = useCallback( (e: React.MouseEvent) => { if (e.ctrlKey || e.metaKey || e.altKey) { @@ -411,6 +412,7 @@ function NavItem({ (currentRouteInfo.params as CommonNavigatorParams['Profile']).name === currentAccount?.handle : isTab(currentRouteInfo.name, pathName) + const isRelated = currentRouteInfo.name.startsWith(pathName) const navigation = useNavigation() const onPressWrapped = useCallback( (e: React.MouseEvent) => { @@ -461,7 +463,7 @@ function NavItem({ height: 30, }, ]}> - {isCurrent ? iconFilled : icon} + {isCurrent || isRelated ? iconFilled : icon} {typeof count === 'string' && count ? (