···6464import {ThemeProvider as Alf} from '#/alf'
6565import {useColorModeTheme} from '#/alf/util/useColorModeTheme'
6666import {Provider as ContextMenuProvider} from '#/components/ContextMenu'
6767-import {NuxDialogs} from '#/components/dialogs/nuxs'
6867import {useStarterPackEntry} from '#/components/hooks/useStarterPackEntry'
6968import {Provider as IntentDialogProvider} from '#/components/intents/IntentDialogs'
7069import {Provider as PortalProvider} from '#/components/Portal'
···157156 <IntentDialogProvider>
158157 <TestCtrls />
159158 <Shell />
160160- <NuxDialogs />
161159 </IntentDialogProvider>
162160 </GestureHandlerRootView>
163161 </HideBottomBarBorderProvider>
-2
src/App.web.tsx
···5454import {ThemeProvider as Alf} from '#/alf'
5555import {useColorModeTheme} from '#/alf/util/useColorModeTheme'
5656import {Provider as ContextMenuProvider} from '#/components/ContextMenu'
5757-import {NuxDialogs} from '#/components/dialogs/nuxs'
5857import {useStarterPackEntry} from '#/components/hooks/useStarterPackEntry'
5958import {Provider as IntentDialogProvider} from '#/components/intents/IntentDialogs'
6059import {Provider as PortalProvider} from '#/components/Portal'
···135134 <HideBottomBarBorderProvider>
136135 <IntentDialogProvider>
137136 <Shell />
138138- <NuxDialogs />
139137 </IntentDialogProvider>
140138 </HideBottomBarBorderProvider>
141139 </ServiceConfigProvider>
+2-2
src/Navigation.tsx
···456456 name="LikesOnRepostsNotificationSettings"
457457 getComponent={() => LikesOnRepostsNotificationSettingsScreen}
458458 options={{
459459- title: title(msg`Likes on your reposts notifications`),
459459+ title: title(msg`Likes of your reposts notifications`),
460460 requireAuth: true,
461461 }}
462462 />
···464464 name="RepostsOnRepostsNotificationSettings"
465465 getComponent={() => RepostsOnRepostsNotificationSettingsScreen}
466466 options={{
467467- title: title(msg`Reposts on your reposts notifications`),
467467+ title: title(msg`Reposts of your reposts notifications`),
468468 requireAuth: true,
469469 }}
470470 />
+53-18
src/components/Link.tsx
···99import {BSKY_DOWNLOAD_URL} from '#/lib/constants'
1010import {useNavigationDeduped} from '#/lib/hooks/useNavigationDeduped'
1111import {useOpenLink} from '#/lib/hooks/useOpenLink'
1212-import {type AllNavigatorParams} from '#/lib/routes/types'
1212+import {type AllNavigatorParams, type RouteParams} from '#/lib/routes/types'
1313import {shareUrl} from '#/lib/sharing'
1414import {
1515 convertBskyAppUrlIfNeeded,
···2525import {useInteractionState} from '#/components/hooks/useInteractionState'
2626import {Text, type TextProps} from '#/components/Typography'
2727import {router} from '#/routes'
2828+import {useGlobalDialogsControlContext} from './dialogs/Context'
28292930/**
3031 * Only available within a `Link`, since that inherits from `Button`.
···112113 }
113114114115 const isExternal = isExternalUrl(href)
115115- const {openModal, closeModal} = useModalControls()
116116+ const {closeModal} = useModalControls()
117117+ const {linkWarningDialogControl} = useGlobalDialogsControlContext()
116118 const openLink = useOpenLink()
117119118120 const goLinksEnabled = useGoLinksEnabled()
···135137 }
136138137139 if (requiresWarning) {
138138- openModal({
139139- name: 'link-warning',
140140- text: displayText,
141141- href: href,
140140+ linkWarningDialogControl.open({
141141+ displayText,
142142+ href,
142143 })
143144 } else {
144145 if (isExternal) {
···158159 } else {
159160 closeModal() // close any active modals
160161162162+ const [screen, params] = router.matchPath(href) as [
163163+ screen: keyof AllNavigatorParams,
164164+ params?: RouteParams,
165165+ ]
166166+167167+ // does not apply to web's flat navigator
168168+ if (isNative && screen !== 'NotFound') {
169169+ const state = navigation.getState()
170170+ // if screen is not in the current navigator, it means it's
171171+ // most likely a tab screen
172172+ if (!state.routeNames.includes(screen)) {
173173+ const parent = navigation.getParent()
174174+ if (
175175+ parent &&
176176+ parent.getState().routeNames.includes(`${screen}Tab`)
177177+ ) {
178178+ // yep, it's a tab screen. i.e. SearchTab
179179+ // thus we need to navigate to the child screen
180180+ // via the parent navigator
181181+ // see https://reactnavigation.org/docs/upgrading-from-6.x/#changes-to-the-navigate-action
182182+ // TODO: can we support the other kinds of actions? push/replace -sfn
183183+184184+ // @ts-expect-error include does not narrow the type unfortunately
185185+ parent.navigate(`${screen}Tab`, {screen, params})
186186+ return
187187+ } else {
188188+ // will probably fail, but let's try anyway
189189+ }
190190+ }
191191+ }
192192+161193 if (action === 'push') {
162162- navigation.dispatch(StackActions.push(...router.matchPath(href)))
194194+ navigation.dispatch(StackActions.push(screen, params))
163195 } else if (action === 'replace') {
164164- navigation.dispatch(
165165- StackActions.replace(...router.matchPath(href)),
166166- )
196196+ navigation.dispatch(StackActions.replace(screen, params))
167197 } else if (action === 'navigate') {
168168- // @ts-ignore
169169- navigation.navigate(...router.matchPath(href))
198198+ // @ts-expect-error not typed
199199+ navigation.navigate(screen, params)
170200 } else {
171201 throw Error('Unsupported navigator action.')
172202 }
···180210 displayText,
181211 isExternal,
182212 href,
183183- openModal,
184213 openLink,
185214 closeModal,
186215 action,
···188217 overridePresentation,
189218 shouldProxy,
190219 goLinksEnabled,
220220+ linkWarningDialogControl,
191221 ],
192222 )
193223···200230 )
201231202232 if (requiresWarning) {
203203- openModal({
204204- name: 'link-warning',
205205- text: displayText,
206206- href: href,
233233+ linkWarningDialogControl.open({
234234+ displayText,
235235+ href,
207236 share: true,
208237 })
209238 } else {
210239 shareUrl(href)
211240 }
212212- }, [disableMismatchWarning, displayText, href, isExternal, openModal])
241241+ }, [
242242+ disableMismatchWarning,
243243+ displayText,
244244+ href,
245245+ isExternal,
246246+ linkWarningDialogControl,
247247+ ])
213248214249 const onLongPress = React.useCallback(
215250 (e: GestureResponderEvent) => {
···3838 <SettingsList.ItemIcon icon={LikeRepostIcon} />
3939 <ItemTextWithSubtitle
4040 bold
4141- titleText={<Trans>Likes on your reposts</Trans>}
4141+ titleText={<Trans>Likes of your reposts</Trans>}
4242 subtitleText={
4343 <Trans>
4444 Get notifications when people like posts that you've reposted.
···1313import * as InviteCodesModal from './InviteCodes'
1414import * as ContentLanguagesSettingsModal from './lang-settings/ContentLanguagesSettings'
1515import * as PostLanguagesSettingsModal from './lang-settings/PostLanguagesSettings'
1616-import * as LinkWarningModal from './LinkWarning'
1716import * as UserAddRemoveListsModal from './UserAddRemoveLists'
18171918const DEFAULT_SNAPPOINTS = ['90%']
···6867 } else if (activeModal?.name === 'change-password') {
6968 snapPoints = ChangePasswordModal.snapPoints
7069 element = <ChangePasswordModal.Component />
7171- } else if (activeModal?.name === 'link-warning') {
7272- snapPoints = LinkWarningModal.snapPoints
7373- element = <LinkWarningModal.Component {...activeModal} />
7470 } else {
7571 return null
7672 }
-3
src/view/com/modals/Modal.web.tsx
···1212import * as InviteCodesModal from './InviteCodes'
1313import * as ContentLanguagesSettingsModal from './lang-settings/ContentLanguagesSettings'
1414import * as PostLanguagesSettingsModal from './lang-settings/PostLanguagesSettings'
1515-import * as LinkWarningModal from './LinkWarning'
1615import * as UserAddRemoveLists from './UserAddRemoveLists'
17161817export function ModalsContainer() {
···6564 element = <PostLanguagesSettingsModal.Component />
6665 } else if (modal.name === 'change-password') {
6766 element = <ChangePasswordModal.Component />
6868- } else if (modal.name === 'link-warning') {
6969- element = <LinkWarningModal.Component {...modal} />
7067 } else {
7168 return null
7269 }
+6-5
src/view/com/util/Link.tsx
···3030import {useModalControls} from '#/state/modals'
3131import {WebAuxClickWrapper} from '#/view/com/util/WebAuxClickWrapper'
3232import {useTheme} from '#/alf'
3333+import {useGlobalDialogsControlContext} from '#/components/dialogs/Context'
3334import {router} from '../../../routes'
3435import {PressableWithHover} from './PressableWithHover'
3536import {Text} from './text/Text'
···189190 onBeforePress?: () => void
190191} & TextProps) {
191192 const navigation = useNavigationDeduped()
192192- const {openModal, closeModal} = useModalControls()
193193+ const {closeModal} = useModalControls()
194194+ const {linkWarningDialogControl} = useGlobalDialogsControlContext()
193195 const openLink = useOpenLink()
194196195197 if (!disableMismatchWarning && typeof text !== 'string') {
···211213 linkRequiresWarning(href, typeof text === 'string' ? text : '')
212214 if (requiresWarning) {
213215 e?.preventDefault?.()
214214- openModal({
215215- name: 'link-warning',
216216- text: typeof text === 'string' ? text : '',
216216+ linkWarningDialogControl.open({
217217+ displayText: typeof text === 'string' ? text : '',
217218 href,
218219 })
219220 }
···245246 onBeforePress,
246247 onPressProp,
247248 closeModal,
248248- openModal,
249249 navigation,
250250 href,
251251 text,
252252 disableMismatchWarning,
253253 navigationAction,
254254 openLink,
255255+ linkWarningDialogControl,
255256 ],
256257 )
257258 const hrefAttrs = useMemo(() => {