From c3b846da02263657745f2c855c3189eb5a2b7ce1 Mon Sep 17 00:00:00 2001 From: Jack Date: Tue, 25 Aug 2020 20:31:36 +0100 Subject: [PATCH] fixed space sound, blind mode disabled sound on error --- public/js/script.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/public/js/script.js b/public/js/script.js index b7a337679..6b5478517 100644 --- a/public/js/script.js +++ b/public/js/script.js @@ -3485,7 +3485,7 @@ $(document).keypress(function (event) { if (thisCharCorrect) { playClickSound(); } else { - if (!config.playSoundOnError) { + if (!config.playSoundOnError || config.blindMode) { playClickSound(); } else { playErrorSound(); @@ -3796,8 +3796,13 @@ $(document).keydown((event) => { updateCaretPosition(); currentKeypress.count++; currentKeypress.words.push(currentWordIndex); + playClickSound(); } else { - playErrorSound(); + if (!config.playSoundOnError || config.blindMode) { + playClickSound(); + } else { + playErrorSound(); + } accuracyStats.incorrect++; let cil = currentInput.length; if (cil < wordsList[currentWordIndex].length) { @@ -3856,7 +3861,6 @@ $(document).keydown((event) => { currentKeypress.count++; currentKeypress.words.push(currentWordIndex); } - playClickSound(); correctedHistory.push(currentCorrected); currentCorrected = ""; if (config.keymapMode === "react") {