about summary refs log tree commit diff
path: root/src/view/com/modals/LinkWarning.tsx
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2024-01-12 10:19:56 -0800
committerGitHub <noreply@github.com>2024-01-12 10:19:56 -0800
commit998ee2998657e82395fe4462809c376ffbd03ed8 (patch)
tree4eb3930734b939c0cfaa36f39a84fd27ca3a831c /src/view/com/modals/LinkWarning.tsx
parentb147f7ae8a5c8c3a1ec9981132b4c6447034963f (diff)
downloadvoidsky-998ee2998657e82395fe4462809c376ffbd03ed8.tar.zst
(optional) In app browser (#2490)
* add expo web browser + modal

* add in app browser option to settings

* don't show toggle on web

* Tweak browser-choice UIs

---------

Co-authored-by: Samuel Newman <mozzius@protonmail.com>
Diffstat (limited to 'src/view/com/modals/LinkWarning.tsx')
-rw-r--r--src/view/com/modals/LinkWarning.tsx6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/view/com/modals/LinkWarning.tsx b/src/view/com/modals/LinkWarning.tsx
index 39e6cc3e6..81fdc7285 100644
--- a/src/view/com/modals/LinkWarning.tsx
+++ b/src/view/com/modals/LinkWarning.tsx
@@ -1,5 +1,5 @@
 import React from 'react'
-import {Linking, SafeAreaView, StyleSheet, View} from 'react-native'
+import {SafeAreaView, StyleSheet, View} from 'react-native'
 import {ScrollView} from './util'
 import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome'
 import {Text} from '../util/text/Text'
@@ -12,6 +12,7 @@ import {isPossiblyAUrl, splitApexDomain} from 'lib/strings/url-helpers'
 import {Trans, msg} from '@lingui/macro'
 import {useLingui} from '@lingui/react'
 import {useModalControls} from '#/state/modals'
+import {useOpenLink} from '#/state/preferences/in-app-browser'
 
 export const snapPoints = ['50%']
 
@@ -21,10 +22,11 @@ export function Component({text, href}: {text: string; href: string}) {
   const {isMobile} = useWebMediaQueries()
   const {_} = useLingui()
   const potentiallyMisleading = isPossiblyAUrl(text)
+  const openLink = useOpenLink()
 
   const onPressVisit = () => {
     closeModal()
-    Linking.openURL(href)
+    openLink(href)
   }
 
   return (