Skip to content

Commit e1fef2b

Browse files
authored
feat(errors): add vibration feedback on error messages (#242)
1 parent 58f005d commit e1fef2b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pages/index.tsx

+5-2
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,12 @@ const Home: NextPage = () => {
2424
}
2525
}, [file])
2626

27-
const onError = (error: string) => {
27+
const onError = (message: string) => {
2828
setErrorCounter((c) => c + 1)
29-
setError(error)
29+
setError(message)
30+
if (message.length > 0 && navigator.vibrate) {
31+
navigator.vibrate(300)
32+
}
3033
}
3134

3235
const onGenerate = async (file: File, pwa: boolean, dark: boolean) => {

0 commit comments

Comments
 (0)