mirror of
https://github.com/tooot-app/app
synced 2025-01-30 18:24:50 +01:00
Persistant 🪜 setting
This commit is contained in:
parent
63c4ffbabf
commit
48e51530b1
@ -36,15 +36,12 @@ const SettingsApp: React.FC = () => {
|
||||
.catch(() => {
|
||||
if (connect) {
|
||||
GLOBAL.connect = false
|
||||
setConnect(false)
|
||||
} else {
|
||||
setShowConnect(false)
|
||||
}
|
||||
})
|
||||
}, [])
|
||||
|
||||
const [clearingCache, setClearingCache] = useState(false)
|
||||
|
||||
return (
|
||||
<MenuContainer>
|
||||
<MenuRow
|
||||
@ -175,7 +172,7 @@ const SettingsApp: React.FC = () => {
|
||||
/>
|
||||
{showConnect ? (
|
||||
<MenuRow
|
||||
title='使用代理'
|
||||
title='使用免费🪜'
|
||||
switchValue={connect || false}
|
||||
switchOnValueChange={() => {
|
||||
GLOBAL.connect = !connect
|
||||
|
@ -11,6 +11,7 @@ import React, { useContext, useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Pressable, TextInput, View } from 'react-native'
|
||||
import AccountContext from '../Context'
|
||||
import haptics from '@components/haptics'
|
||||
|
||||
const AccountInformationPrivateNote: React.FC = () => {
|
||||
const { relationship, pageMe } = useContext(AccountContext)
|
||||
@ -24,6 +25,7 @@ const AccountInformationPrivateNote: React.FC = () => {
|
||||
const queryKey: QueryKeyRelationship = ['Relationship', { id: relationship?.id }]
|
||||
const mutation = useRelationshipMutation({
|
||||
onMutate: async vars => {
|
||||
haptics('Light')
|
||||
await queryClient.cancelQueries({ queryKey })
|
||||
queryClient.setQueryData<Mastodon.Relationship[]>(queryKey, old => {
|
||||
return old
|
||||
|
@ -1,6 +1,5 @@
|
||||
import { mapEnvironment } from '@utils/helpers/checkEnvironment'
|
||||
import { GLOBAL } from '@utils/storage'
|
||||
import { setGlobalStorage } from '@utils/storage/actions'
|
||||
import axios from 'axios'
|
||||
import * as Linking from 'expo-linking'
|
||||
import { userAgent } from '.'
|
||||
@ -119,6 +118,5 @@ export const connectVerify = () =>
|
||||
headers: { ...userAgent }
|
||||
}).catch(err => {
|
||||
GLOBAL.connect = false
|
||||
setGlobalStorage('app.connect', false)
|
||||
return Promise.reject(err)
|
||||
})
|
||||
|
@ -1,6 +1,5 @@
|
||||
import * as Sentry from '@sentry/react-native'
|
||||
import { GLOBAL } from '@utils/storage'
|
||||
import { setGlobalStorage } from '@utils/storage/actions'
|
||||
import chalk from 'chalk'
|
||||
import Constants from 'expo-constants'
|
||||
import * as Linking from 'expo-linking'
|
||||
@ -23,7 +22,6 @@ const handleError =
|
||||
if (GLOBAL.connect) {
|
||||
if (error?.response?.status == 403 && error?.response?.data == 'connect_blocked') {
|
||||
GLOBAL.connect = false
|
||||
setGlobalStorage('app.connect', false)
|
||||
}
|
||||
}
|
||||
const shouldReportToSentry = config && (config.captureRequest || config.captureResponse)
|
||||
|
Loading…
x
Reference in New Issue
Block a user