1
0
mirror of https://github.com/tooot-app/app synced 2024-12-22 07:34:06 +01:00
This commit is contained in:
xmflsct 2022-12-20 23:09:21 +01:00
parent 2ac1d49f9f
commit 54c99eb054
4 changed files with 17 additions and 21 deletions

View File

@ -1,5 +1 @@
Enjoy toooting! This version includes following improvements and fixes: Enjoy toooting! This version includes following improvements and fixes:
- Align filter experience with v4.0 and above
- Supports enlarging user's avatar and banner
- Fix iPad weird sizing (not optimisation)
- Experiment (!) support of Pleroma

View File

@ -1,5 +1 @@
toooting愉快此版本包括以下改进和修复 toooting愉快此版本包括以下改进和修复
- 改进过滤体验与v4.0以上版本一致
- 支持查看用户的头像和横幅图片
- 修复iPad部分尺寸问题非优化
- 试验性支持Pleroma

View File

@ -1,6 +1,6 @@
{ {
"name": "tooot", "name": "tooot",
"version": "4.7.1", "version": "4.7.2",
"description": "tooot for Mastodon", "description": "tooot for Mastodon",
"author": "xmflsct <me@xmflsct.com>", "author": "xmflsct <me@xmflsct.com>",
"license": "GPL-3.0-or-later", "license": "GPL-3.0-or-later",

View File

@ -7,6 +7,7 @@ import { SearchResult } from '@utils/queryHooks/search'
import { getSettingsBrowser } from '@utils/slices/settingsSlice' import { getSettingsBrowser } from '@utils/slices/settingsSlice'
import * as Linking from 'expo-linking' import * as Linking from 'expo-linking'
import * as WebBrowser from 'expo-web-browser' import * as WebBrowser from 'expo-web-browser'
import validUrl from 'valid-url'
export let loadingLink = false export let loadingLink = false
@ -86,18 +87,21 @@ const openLink = async (url: string, navigation?: any) => {
} }
loadingLink = false loadingLink = false
switch (getSettingsBrowser(store.getState())) { const validatedUrl = validUrl.isWebUri(url)
// Some links might end with an empty space at the end that triggers an error if (validatedUrl) {
case 'internal': switch (getSettingsBrowser(store.getState())) {
await WebBrowser.openBrowserAsync(encodeURI(url), { // Some links might end with an empty space at the end that triggers an error
dismissButtonStyle: 'close', case 'internal':
enableBarCollapsing: true, await WebBrowser.openBrowserAsync(validatedUrl, {
...(await browserPackage()) dismissButtonStyle: 'close',
}) enableBarCollapsing: true,
break ...(await browserPackage())
case 'external': })
await Linking.openURL(encodeURI(url)) break
break case 'external':
await Linking.openURL(validatedUrl)
break
}
} }
} }