mirror of https://github.com/tooot-app/app
Reset when verification failed
This commit is contained in:
parent
4aa96ba2bd
commit
dc893b0d5d
|
@ -1,8 +1,10 @@
|
||||||
import * as Sentry from '@sentry/react-native'
|
import * as Sentry from '@sentry/react-native'
|
||||||
|
import { setGlobalStorage } from '@utils/storage/actions'
|
||||||
import chalk from 'chalk'
|
import chalk from 'chalk'
|
||||||
import Constants from 'expo-constants'
|
import Constants from 'expo-constants'
|
||||||
import { Platform } from 'react-native'
|
import { Platform } from 'react-native'
|
||||||
import parse from 'url-parse'
|
import parse from 'url-parse'
|
||||||
|
import { GLOBAL } from '../../../App'
|
||||||
|
|
||||||
const userAgent = {
|
const userAgent = {
|
||||||
'User-Agent': `tooot/${Constants.expoConfig?.version} ${Platform.OS}/${Platform.Version}`
|
'User-Agent': `tooot/${Constants.expoConfig?.version} ${Platform.OS}/${Platform.Version}`
|
||||||
|
@ -18,6 +20,12 @@ const handleError =
|
||||||
} | void
|
} | void
|
||||||
) =>
|
) =>
|
||||||
(error: any) => {
|
(error: any) => {
|
||||||
|
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)
|
const shouldReportToSentry = config && (config.captureRequest || config.captureResponse)
|
||||||
shouldReportToSentry && Sentry.setContext('Error object', error)
|
shouldReportToSentry && Sentry.setContext('Error object', error)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue