mirror of
https://github.com/tooot-app/app
synced 2025-06-05 22:19:13 +02:00
Fix #733
This commit is contained in:
@ -22,7 +22,6 @@ import * as AuthSession from 'expo-auth-session'
|
||||
import * as Crypto from 'expo-crypto'
|
||||
import { Image } from 'expo-image'
|
||||
import * as Linking from 'expo-linking'
|
||||
import * as WebBrowser from 'expo-web-browser'
|
||||
import { debounce } from 'lodash'
|
||||
import React, { RefObject, useCallback, useState } from 'react'
|
||||
import { Trans, useTranslation } from 'react-i18next'
|
||||
@ -30,6 +29,7 @@ import { Alert, KeyboardAvoidingView, Platform, TextInput, View } from 'react-na
|
||||
import { ScrollView } from 'react-native-gesture-handler'
|
||||
import { fromByteArray } from 'react-native-quick-base64'
|
||||
import CustomText from '../Text'
|
||||
import openLink from '@components/openLink'
|
||||
|
||||
export interface Props {
|
||||
scrollViewRef?: RefObject<ScrollView>
|
||||
@ -386,20 +386,12 @@ const ComponentInstance: React.FC<Props> = ({
|
||||
<CustomText
|
||||
accessible
|
||||
style={{ color: colors.blue }}
|
||||
onPress={async () =>
|
||||
WebBrowser.openBrowserAsync('https://tooot.app/privacy-policy', {
|
||||
...(await browserPackage())
|
||||
})
|
||||
}
|
||||
onPress={async () => openLink('https://tooot.app/privacy-policy')}
|
||||
/>,
|
||||
<CustomText
|
||||
accessible
|
||||
style={{ color: colors.blue }}
|
||||
onPress={async () =>
|
||||
WebBrowser.openBrowserAsync('https://tooot.app/terms-of-service', {
|
||||
...(await browserPackage())
|
||||
})
|
||||
}
|
||||
onPress={async () => openLink('https://tooot.app/terms-of-service')}
|
||||
/>
|
||||
]}
|
||||
/>
|
||||
|
@ -8,6 +8,7 @@ import { QueryKeyStatus } from '@utils/queryHooks/status'
|
||||
import { getGlobalStorage } from '@utils/storage/actions'
|
||||
import * as Linking from 'expo-linking'
|
||||
import * as WebBrowser from 'expo-web-browser'
|
||||
import { WebBrowserPresentationStyle } from 'expo-web-browser'
|
||||
|
||||
const openLink = async (url: string, navigation?: any) => {
|
||||
const handleNavigation = (page: 'Tab-Shared-Toot' | 'Tab-Shared-Account', options: any) => {
|
||||
@ -74,6 +75,7 @@ const openLink = async (url: string, navigation?: any) => {
|
||||
default:
|
||||
await WebBrowser.openBrowserAsync(url.trim(), {
|
||||
dismissButtonStyle: 'close',
|
||||
presentationStyle: WebBrowserPresentationStyle.AUTOMATIC,
|
||||
enableBarCollapsing: true,
|
||||
...(await browserPackage())
|
||||
}).catch(() => Linking.openURL(url.trim()))
|
||||
|
Reference in New Issue
Block a user