my fork of the bluesky client

show a toast when a haptic is meant to fire while using simulator (#5481)

buzzz!

authored by samuel.fm and committed by

GitHub 60b74435 3293c5e0

+7
+7
src/lib/haptics.ts
··· 1 1 import React from 'react' 2 + import * as Device from 'expo-device' 2 3 import {impactAsync, ImpactFeedbackStyle} from 'expo-haptics' 3 4 4 5 import {isIOS, isWeb} from '#/platform/detection' 5 6 import {useHapticsDisabled} from '#/state/preferences/disable-haptics' 7 + import * as Toast from '#/view/com/util/Toast' 6 8 7 9 export function useHaptics() { 8 10 const isHapticsDisabled = useHapticsDisabled() ··· 18 20 ? ImpactFeedbackStyle[strength] 19 21 : ImpactFeedbackStyle.Light 20 22 impactAsync(style) 23 + 24 + // DEV ONLY - show a toast when a haptic is meant to fire on simulator 25 + if (__DEV__ && !Device.isDevice) { 26 + Toast.show(`Buzzz!`) 27 + } 21 28 }, 22 29 [isHapticsDisabled], 23 30 )