From 4ed1f0679c90996f725c22c3f1fd639b74553a31 Mon Sep 17 00:00:00 2001 From: Jack Date: Wed, 27 May 2020 14:06:59 +0100 Subject: [PATCH] fixed a bug where the account page would not load, fixed a bug where the letter I would appear again, this time with punctuation --- public/js/script.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/js/script.js b/public/js/script.js index 165030a4f..a1b1dbc4d 100644 --- a/public/js/script.js +++ b/public/js/script.js @@ -190,10 +190,10 @@ function addWord() { let language = words[config.language]; let randomWord = language[Math.floor(Math.random() * language.length)]; previousWord = wordsList[wordsList.length - 1]; - while (randomWord.indexOf(' ') > -1) { + while (randomWord.indexOf(' ') > -1 || (!config.punctuation && randomWord == "I") || randomWord.indexOf(' ') > -1) { randomWord = language[Math.floor(Math.random() * language.length)]; } - if (config.punctuation && config.mode != "custom" || (!config.punctuation && randomWord == "I") || randomWord.indexOf(' ') > -1){ + if (config.punctuation && config.mode != "custom"){ randomWord = punctuateWord(previousWord, randomWord, wordsList.length, 0) } wordsList.push(randomWord); @@ -623,7 +623,7 @@ function restartTest() { clearIntervals(); time = 0; afkDetected = false; - resultHistoryChart = false; + resultVisible = false; wpmHistory = []; setFocus(false); hideCaret();