mode sure custom results can be saved

not showing pb line if value is 0
This commit is contained in:
Jack 2020-06-27 22:17:41 +01:00
parent 9efd938b74
commit 197e413014

View file

@ -714,13 +714,15 @@ function showResult(difficultyFailed = false) {
});
let mode2 = "";
if (config.mode == "time") {
if (config.mode === "time") {
mode2 = config.time;
// $("#result .stats .time").addClass('hidden');
} else if (config.mode == "words") {
} else if (config.mode === "words") {
mode2 = config.words;
// $("#result .stats .time").removeClass('hidden');
// $("#result .stats .time .bottom").text(roundedToFixed(stats.time,1)+'s');
} else if (config.mode === "custom"){
mode2 = "custom";
}
@ -794,9 +796,11 @@ function showResult(difficultyFailed = false) {
}
localPb = true;
}
wpmOverTimeChart.options.annotation.annotations[0].value = d2;
wpmOverTimeChart.options.annotation.annotations[0].label.content = "PB: "+ d2;
wpmOverTimeChart.update();
if(d2 > 0){
wpmOverTimeChart.options.annotation.annotations[0].value = d2;
wpmOverTimeChart.options.annotation.annotations[0].label.content = "PB: "+ d2;
wpmOverTimeChart.update();
}
})
})