From a366687ec6f425d452fc5f38cf7feb10682ee1d6 Mon Sep 17 00:00:00 2001 From: Zhiyuan Zheng Date: Thu, 11 Mar 2021 22:31:00 +0100 Subject: [PATCH] Fixed #52 --- src/components/haptics.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/haptics.ts b/src/components/haptics.ts index 6bc9d9e1..ef77d42a 100644 --- a/src/components/haptics.ts +++ b/src/components/haptics.ts @@ -5,7 +5,9 @@ const haptics = ( type: 'Success' | 'Warning' | 'Error' | 'Light' | 'Medium' | 'Heavy' ) => { if (Platform.OS === 'android') { - Haptics.impactAsync(Haptics.ImpactFeedbackStyle['Light']).catch(error => {}) + if (type === 'Error') { + Haptics.impactAsync(Haptics.ImpactFeedbackStyle['Light']).catch(() => {}) + } return } @@ -14,13 +16,13 @@ const haptics = ( case 'Warning': case 'Error': Haptics.notificationAsync(Haptics.NotificationFeedbackType[type]).catch( - error => {} + () => {} ) break case 'Light': case 'Medium': case 'Heavy': - Haptics.impactAsync(Haptics.ImpactFeedbackStyle[type]).catch(error => {}) + Haptics.impactAsync(Haptics.ImpactFeedbackStyle[type]).catch(() => {}) } }