1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00
This commit is contained in:
Zhiyuan Zheng
2021-03-14 00:47:55 +01:00
parent 32a7d23dc9
commit 5fe6cd59f9
12 changed files with 141 additions and 144 deletions

View File

@ -42,43 +42,45 @@ const pushUseConnect = ({
expoToken
},
sentry: true
}).catch(() => {
displayMessage({
mode,
type: 'error',
duration: 'long',
message: t('meSettingsPush:error.message'),
description: t('meSettingsPush:error.description'),
onPress: () => {
navigationRef.current?.navigate('Screen-Tabs', {
screen: 'Tab-Me',
params: {
screen: 'Tab-Me-Root'
}
})
navigationRef.current?.navigate('Screen-Tabs', {
screen: 'Tab-Me',
params: {
screen: 'Tab-Me-Settings'
}
})
}
})
}).catch(error => {
if (error.status == 410) {
displayMessage({
mode,
type: 'error',
duration: 'long',
message: t('meSettingsPush:error.message'),
description: t('meSettingsPush:error.description'),
onPress: () => {
navigationRef.current?.navigate('Screen-Tabs', {
screen: 'Tab-Me',
params: {
screen: 'Tab-Me-Root'
}
})
navigationRef.current?.navigate('Screen-Tabs', {
screen: 'Tab-Me',
params: {
screen: 'Tab-Me-Settings'
}
})
}
})
dispatch(disableAllPushes())
dispatch(disableAllPushes())
instances.forEach(instance => {
if (instance.push.global.value) {
apiGeneral<{}>({
method: 'delete',
domain: instance.url,
url: 'api/v1/push/subscription',
headers: {
Authorization: `Bearer ${instance.token}`
}
}).catch(() => console.log('error!!!'))
}
})
instances.forEach(instance => {
if (instance.push.global.value) {
apiGeneral<{}>({
method: 'delete',
domain: instance.url,
url: 'api/v1/push/subscription',
headers: {
Authorization: `Bearer ${instance.token}`
}
}).catch(() => console.log('error!!!'))
}
})
}
})
}