mirror of
https://github.com/tooot-app/app
synced 2025-01-21 21:35:34 +01:00
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 { setGlobalStorage } from '@utils/storage/actions'
|
||||
import chalk from 'chalk'
|
||||
import Constants from 'expo-constants'
|
||||
import { Platform } from 'react-native'
|
||||
import parse from 'url-parse'
|
||||
import { GLOBAL } from '../../../App'
|
||||
|
||||
const userAgent = {
|
||||
'User-Agent': `tooot/${Constants.expoConfig?.version} ${Platform.OS}/${Platform.Version}`
|
||||
@ -18,6 +20,12 @@ const handleError =
|
||||
} | void
|
||||
) =>
|
||||
(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)
|
||||
shouldReportToSentry && Sentry.setContext('Error object', error)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user