feat(errors): add vibration feedback on error messages (#242)

This commit is contained in:
Rui Saraiva 2020-09-21 22:01:35 +01:00 committed by GitHub
parent 58f005de76
commit e1fef2b4e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,9 +24,12 @@ const Home: NextPage = () => {
}
}, [file])
const onError = (error: string) => {
const onError = (message: string) => {
setErrorCounter((c) => c + 1)
setError(error)
setError(message)
if (message.length > 0 && navigator.vibrate) {
navigator.vibrate(300)
}
}
const onGenerate = async (file: File, pwa: boolean, dark: boolean) => {