From 65cd13c5ff4d390238e3a40079e66469efdce954 Mon Sep 17 00:00:00 2001 From: adueck Date: Tue, 15 Nov 2022 14:43:56 +0500 Subject: [PATCH] fix error with navigator.vibrate crashing safari --- README.md | 1 - src/games/GameCore.tsx | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5a03bbc..099f2ba 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ # LingDocs Pashto Grammar [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) - [![Netlify Status](https://api.netlify.com/api/v1/badges/150beb8b-aae1-4cef-a05c-2add5d8904f7/deploy-status)](https://app.netlify.com/sites/pashto-grammar/deploys) ![build](https://github.com/lingdocs/grammar.lingdocs.com/actions/workflows/main.yml/badge.svg) diff --git a/src/games/GameCore.tsx b/src/games/GameCore.tsx index cf8bcb0..db1d3ff 100644 --- a/src/games/GameCore.tsx +++ b/src/games/GameCore.tsx @@ -214,7 +214,9 @@ function GameCore({ inChapter, getQuestion, amount, Display, DisplayCo } } function punish() { - navigator.vibrate(errorVibration); + if (navigator.vibrate) { + navigator.vibrate(errorVibration); + } } function handleResult(done: boolean) { const result: AT.TestResult = {