Handle bsky.app links natively

This commit is contained in:
Paul Frazee
2022-11-23 10:51:20 -06:00
parent 27f94052e9
commit 4b8de11046
2 changed files with 16 additions and 3 deletions
+3 -2
View File
@@ -8,8 +8,8 @@ import {
TextStyle,
ViewStyle,
} from 'react-native'
import {useStores} from '../../../state'
import {RootStoreModel} from '../../../state'
import {useStores, RootStoreModel} from '../../../state'
import {convertBskyAppUrlIfNeeded} from '../../../lib/strings'
export const Link = observer(function Link({
style,
@@ -66,6 +66,7 @@ export const TextLink = observer(function Link({
})
function handleLink(store: RootStoreModel, href: string, longPress: boolean) {
href = convertBskyAppUrlIfNeeded(href)
if (href.startsWith('http')) {
Linking.openURL(href)
} else if (longPress) {