From 6e4fe37bf59721f4a6b6f885fe5421a156af6b31 Mon Sep 17 00:00:00 2001 From: Jack Date: Tue, 14 Jul 2020 16:57:23 +0100 Subject: [PATCH] fixed a bug where the live wpm would be hidden if the first word is not completed within the first second --- public/js/script.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/public/js/script.js b/public/js/script.js index 14ae0c870..2bb2fb5a6 100644 --- a/public/js/script.js +++ b/public/js/script.js @@ -1794,7 +1794,11 @@ function liveWpmAndRaw() { function updateLiveWpm(wpm) { if (!config.showLiveWpm) return; - if (wpm == 0 || !testActive) hideLiveWpm(); + if (!testActive) { + hideLiveWpm(); + } else { + showLiveWpm(); + } // let wpmstring = wpm < 100 ? ` ${wpm}` : `${wpm}`; document.querySelector("#liveWpm").innerHTML = wpm; // $("#liveWpm").html(wpm); @@ -1810,6 +1814,7 @@ function showLiveWpm() { } function hideLiveWpm() { + console.log("hiding"); $("#liveWpm").css("opacity", 0); }