1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00
This commit is contained in:
Zhiyuan Zheng
2021-01-01 16:48:16 +01:00
parent 5473fcb770
commit 6aed76ac65
38 changed files with 632 additions and 637 deletions

View File

@ -0,0 +1,17 @@
import { store } from '@root/store'
import { getSettingsBrowser } from '@utils/slices/settingsSlice'
import * as Linking from 'expo-linking'
import * as WebBrowser from 'expo-web-browser'
const openLink = async (url: string) => {
switch (getSettingsBrowser(store.getState())) {
case 'internal':
await WebBrowser.openBrowserAsync(url)
break
case 'external':
await Linking.openURL(url)
break
}
}
export default openLink