fix error with navigator.vibrate crashing safari

This commit is contained in:
adueck 2022-11-15 14:43:56 +05:00
parent be7be4ef43
commit 65cd13c5ff
2 changed files with 3 additions and 2 deletions

View File

@ -1,7 +1,6 @@
# LingDocs Pashto Grammar # LingDocs Pashto Grammar
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) [![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) [![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) ![build](https://github.com/lingdocs/grammar.lingdocs.com/actions/workflows/main.yml/badge.svg)

View File

@ -214,8 +214,10 @@ function GameCore<Question>({ inChapter, getQuestion, amount, Display, DisplayCo
} }
} }
function punish() { function punish() {
if (navigator.vibrate) {
navigator.vibrate(errorVibration); navigator.vibrate(errorVibration);
} }
}
function handleResult(done: boolean) { function handleResult(done: boolean) {
const result: AT.TestResult = { const result: AT.TestResult = {
done, done,