···11 type ViewStyle,
12} from 'react-native'
13import {sanitizeUrl} from '@braintree/sanitize-url'
14-import {StackActions} from '@react-navigation/native'
1516import {
17 type DebouncedNavigationProp,
···421 if (tabState === TabState.InsideAtRoot) {
422 emitSoftReset()
423 } else {
00424 // @ts-ignore we're not able to type check on this one -prf
425- navigation.navigate(routeName, params)
426 }
427 } else {
428 throw Error('Unsupported navigator action.')
···11 type ViewStyle,
12} from 'react-native'
13import {sanitizeUrl} from '@braintree/sanitize-url'
01415import {
16 type DebouncedNavigationProp,
···420 if (tabState === TabState.InsideAtRoot) {
421 emitSoftReset()
422 } else {
423+ // note: 'navigate' actually acts the same as 'push' nowadays
424+ // therefore we need to add 'pop' -sfn
425 // @ts-ignore we're not able to type check on this one -prf
426+ navigation.navigate(routeName, params, {pop: true})
427 }
428 } else {
429 throw Error('Unsupported navigator action.')
+10-9
src/view/shell/desktop/LeftNav.tsx
···3import {type AppBskyActorDefs} from '@atproto/api'
4import {msg, plural, Trans} from '@lingui/macro'
5import {useLingui} from '@lingui/react'
6-import {
7- useLinkTo,
8- useNavigation,
9- useNavigationState,
10-} from '@react-navigation/native'
1112import {useActorStatus} from '#/lib/actor-status'
13import {useAccountSwitcher} from '#/lib/hooks/useAccountSwitcher'
···16import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries'
17import {getCurrentRoute, isTab} from '#/lib/routes/helpers'
18import {makeProfileLink} from '#/lib/routes/links'
19-import {type CommonNavigatorParams} from '#/lib/routes/types'
00020import {useGate} from '#/lib/statsig/statsig'
21import {sanitizeDisplayName} from '#/lib/strings/display-names'
22import {isInvalidHandle, sanitizeHandle} from '#/lib/strings/handles'
···339 (currentRouteInfo.params as CommonNavigatorParams['Profile']).name ===
340 currentAccount?.handle
341 : isTab(currentRouteInfo.name, pathName)
342- const linkTo = useLinkTo()
343 const onPressWrapped = useCallback(
344 (e: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => {
345 if (e.ctrlKey || e.metaKey || e.altKey) {
···349 if (isCurrent) {
350 emitSoftReset()
351 } else {
352- linkTo(href)
00353 }
354 },
355- [linkTo, href, isCurrent],
356 )
357358 return (
···3import {type AppBskyActorDefs} from '@atproto/api'
4import {msg, plural, Trans} from '@lingui/macro'
5import {useLingui} from '@lingui/react'
6+import {useNavigation, useNavigationState} from '@react-navigation/native'
000078import {useActorStatus} from '#/lib/actor-status'
9import {useAccountSwitcher} from '#/lib/hooks/useAccountSwitcher'
···12import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries'
13import {getCurrentRoute, isTab} from '#/lib/routes/helpers'
14import {makeProfileLink} from '#/lib/routes/links'
15+import {
16+ type CommonNavigatorParams,
17+ type NavigationProp,
18+} from '#/lib/routes/types'
19import {useGate} from '#/lib/statsig/statsig'
20import {sanitizeDisplayName} from '#/lib/strings/display-names'
21import {isInvalidHandle, sanitizeHandle} from '#/lib/strings/handles'
···338 (currentRouteInfo.params as CommonNavigatorParams['Profile']).name ===
339 currentAccount?.handle
340 : isTab(currentRouteInfo.name, pathName)
341+ const navigation = useNavigation<NavigationProp>()
342 const onPressWrapped = useCallback(
343 (e: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => {
344 if (e.ctrlKey || e.metaKey || e.altKey) {
···348 if (isCurrent) {
349 emitSoftReset()
350 } else {
351+ const [screen, params] = router.matchPath(href)
352+ // @ts-expect-error TODO: type matchPath well enough that it can be plugged into navigation.navigate directly
353+ navigation.popTo(screen, params)
354 }
355 },
356+ [navigation, href, isCurrent],
357 )
358359 return (