fixed a bug where the live wpm would be hidden if the first word is not completed within the first second

This commit is contained in:
Jack 2020-07-14 16:57:23 +01:00
parent 5aaf05cc43
commit 6e4fe37bf5

View file

@ -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 ? `&nbsp;${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);
}