keep message tab icon highlighted

This commit is contained in:
Samuel Newman
2026-04-17 20:58:31 +03:00
parent b433b4ff34
commit c76e7eb9b9
2 changed files with 10 additions and 9 deletions
+1 -5
View File
@@ -46,11 +46,7 @@ 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 === route ||
current === `${route}Tab` ||
current === `${route}Inner`
)
return current.startsWith(route)
}
export enum TabState {
+9 -4
View File
@@ -295,12 +295,17 @@ function SwitcherMenuProfileLink() {
}
return getCurrentRoute(state)
})
let isCurrent =
currentRouteInfo.name === 'Profile'
? isTab(currentRouteInfo.name, pathName) &&
const isCurrent = useMemo(() => {
if (currentRouteInfo.name === 'Profile') {
return (
isTab(currentRouteInfo.name, pathName) &&
(currentRouteInfo.params as CommonNavigatorParams['Profile']).name ===
currentAccount?.handle
: isTab(currentRouteInfo.name, pathName)
)
} else {
return isTab(currentRouteInfo.name, pathName)
}
}, [currentAccount?.handle, currentRouteInfo, pathName])
const onProfilePress = useCallback(
(e: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => {
if (e.ctrlKey || e.metaKey || e.altKey) {