From f95462889ff6b058bef6587dbea524ce0c169f63 Mon Sep 17 00:00:00 2001 From: Zhiyuan Zheng Date: Wed, 20 Jan 2021 13:19:06 +0100 Subject: [PATCH] App crashes maybe caused by Sentry https://github.com/expo/sentry-expo/issues/120 --- src/components/haptics.ts | 16 +++++++++------- src/components/toast.tsx | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/components/haptics.ts b/src/components/haptics.ts index b45fd141..0f2b6bff 100644 --- a/src/components/haptics.ts +++ b/src/components/haptics.ts @@ -6,9 +6,9 @@ const haptics = ( type: 'Success' | 'Warning' | 'Error' | 'Light' | 'Medium' | 'Heavy' ) => { if (Platform.OS === 'android') { - Haptics.impactAsync(Haptics.ImpactFeedbackStyle['Light']).catch(error => - Sentry.Native.captureException(error) - ) + Haptics.impactAsync(Haptics.ImpactFeedbackStyle['Light']).catch(error => { + // Sentry.Native.captureException(error) + }) return } @@ -17,15 +17,17 @@ const haptics = ( case 'Warning': case 'Error': Haptics.notificationAsync(Haptics.NotificationFeedbackType[type]).catch( - error => Sentry.Native.captureException(error) + error => { + // Sentry.Native.captureException(error) + } ) break case 'Light': case 'Medium': case 'Heavy': - Haptics.impactAsync(Haptics.ImpactFeedbackStyle[type]).catch(error => - Sentry.Native.captureException(error) - ) + Haptics.impactAsync(Haptics.ImpactFeedbackStyle[type]).catch(error => { + // Sentry.Native.captureException(error) + }) } } diff --git a/src/components/toast.tsx b/src/components/toast.tsx index e62c9762..c8075d4b 100644 --- a/src/components/toast.tsx +++ b/src/components/toast.tsx @@ -103,7 +103,7 @@ const toastConfig = { success: (config: Config) => , warning: (config: Config) => , error: (config: Config) => { - Sentry.Native.captureException([config.text1, config.text2]) + // Sentry.Native.captureException([config.text1, config.text2]) return } }