From cdb1e2dbdf778932909ac07f661c7945c0d9d90f Mon Sep 17 00:00:00 2001 From: Jack Date: Fri, 25 Sep 2020 20:26:59 +0100 Subject: [PATCH] live wpm shows raw instead of wpm when blind mode is enabled --- public/js/script.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/public/js/script.js b/public/js/script.js index 7ded312da..d80a19b24 100644 --- a/public/js/script.js +++ b/public/js/script.js @@ -2422,7 +2422,7 @@ function startTest() { // wpmHistory.push(wpm); // rawHistory.push(liveRaw()); let wpmAndRaw = liveWpmAndRaw(); - updateLiveWpm(wpmAndRaw.wpm); + updateLiveWpm(wpmAndRaw.wpm, wpmAndRaw.raw); wpmHistory.push(wpmAndRaw.wpm); rawHistory.push(wpmAndRaw.raw); @@ -2879,15 +2879,19 @@ function liveWpmAndRaw() { }; } -function updateLiveWpm(wpm) { +function updateLiveWpm(wpm,raw) { if (!testActive || !config.showLiveWpm) { hideLiveWpm(); } else { showLiveWpm(); } // let wpmstring = wpm < 100 ? ` ${wpm}` : `${wpm}`; - document.querySelector("#miniTimerAndLiveWpm .wpm").innerHTML = wpm; - document.querySelector("#liveWpm").innerHTML = wpm; + let number = wpm; + if (config.blindMode) { + number = raw; + } + document.querySelector("#miniTimerAndLiveWpm .wpm").innerHTML = number; + document.querySelector("#liveWpm").innerHTML = number; // $("#liveWpm").html(wpm); }