not showing balloons when no data is there

This commit is contained in:
Jack 2020-08-11 15:40:01 +01:00
parent d312afee01
commit e92b68bc3a
2 changed files with 6 additions and 1 deletions

View file

@ -279,7 +279,9 @@ function secondsToString(sec) {
let secondsString;
hours < 10 ? (hoursString = "0" + hours) : (hoursString = hours);
minutes < 10 ? (minutesString = "0" + minutes) : (minutesString = minutes);
seconds < 10 ? (secondsString = "0" + seconds) : (secondsString = seconds);
seconds < 10 && minutes > 0
? (secondsString = "0" + seconds)
: (secondsString = seconds);
let ret = "";
if (hours > 0) ret += hoursString + ":";

View file

@ -1317,6 +1317,9 @@ function showResult(difficultyFailed = false) {
$("#result .stats .raw .bottom").text(roundTo2(stats.wpmRaw));
$("#result .stats .acc .bottom").text(roundTo2(stats.acc) + "%");
$("#result .stats .time .bottom").text(roundTo2(testtime) + "s");
$("#result .stats .wpm .bottom").removeAttr("aria-label");
$("#result .stats .raw .bottom").removeAttr("aria-label");
$("#result .stats .acc .bottom").removeAttr("aria-label");
$("#result .stats .time .bottom").attr("aria-label", `${afkseconds}s afk`);
} else {
$("#result .stats .wpm .bottom").text(Math.round(stats.wpm));