This commit is contained in:
Zhiyuan Zheng 2021-04-19 17:35:01 +02:00
parent 7a12792393
commit 251695cc46
No known key found for this signature in database
GPG Key ID: 078A93AB607D85E0
1 changed files with 2 additions and 14 deletions

View File

@ -2,7 +2,6 @@ import analytics from '@components/analytics'
import Icon from '@components/Icon' import Icon from '@components/Icon'
import { MenuContainer, MenuRow } from '@components/Menu' import { MenuContainer, MenuRow } from '@components/Menu'
import { useNavigation } from '@react-navigation/native' import { useNavigation } from '@react-navigation/native'
import { useSearchQuery } from '@utils/queryHooks/search'
import { StyleConstants } from '@utils/styles/constants' import { StyleConstants } from '@utils/styles/constants'
import { useTheme } from '@utils/styles/ThemeManager' import { useTheme } from '@utils/styles/ThemeManager'
import * as Updates from 'expo-updates' import * as Updates from 'expo-updates'
@ -20,11 +19,6 @@ const SettingsTooot: React.FC = () => {
const { theme } = useTheme() const { theme } = useTheme()
const { t } = useTranslation('screenTabs') const { t } = useTranslation('screenTabs')
const { isLoading, data } = useSearchQuery({
term: '@tooot@xmflsct.com',
options: { enabled: instanceActive !== -1 }
})
return ( return (
<MenuContainer> <MenuContainer>
<MenuRow <MenuRow
@ -66,7 +60,6 @@ const SettingsTooot: React.FC = () => {
) : null} ) : null}
<MenuRow <MenuRow
title={t('me.settings.contact.heading')} title={t('me.settings.contact.heading')}
loading={isLoading}
content={ content={
<Icon <Icon
name='Mail' name='Mail'
@ -76,15 +69,10 @@ const SettingsTooot: React.FC = () => {
} }
iconBack='ChevronRight' iconBack='ChevronRight'
onPress={() => { onPress={() => {
const foundAccounts = data?.accounts.filter( if (instanceActive !== -1) {
account =>
account.acct === 'tooot@xmflsct.com' ||
account.url === 'https://social.xmflsct.com/@tooot'
)
if (foundAccounts?.length === 1) {
navigation.navigate('Screen-Compose', { navigation.navigate('Screen-Compose', {
type: 'conversation', type: 'conversation',
accts: [foundAccounts[0].acct] accts: ['tooot@xmflsct.com']
}) })
} else { } else {
WebBrowser.openBrowserAsync('https://social.xmflsct.com/@tooot') WebBrowser.openBrowserAsync('https://social.xmflsct.com/@tooot')