keep message tab icon highlighted
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user