From f1aa40766ffbaf996a847af61a4e39d87a457c2a Mon Sep 17 00:00:00 2001 From: Jack Date: Wed, 19 Aug 2020 19:34:54 +0100 Subject: [PATCH] fixed pb not showing up --- public/js/script.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/public/js/script.js b/public/js/script.js index f6159072d..dd284aebe 100644 --- a/public/js/script.js +++ b/public/js/script.js @@ -1627,15 +1627,12 @@ function showResult(difficultyFailed = false) { } localPb = true; } - if (highestwpm > 0) { - wpmOverTimeChart.options.annotation.annotations[0].value = highestwpm; + if (lpb > 0) { + wpmOverTimeChart.options.annotation.annotations[0].value = lpb; wpmOverTimeChart.options.annotation.annotations[0].label.content = - "PB: " + highestwpm; - if ( - maxChartVal >= highestwpm - 15 && - maxChartVal <= highestwpm + 15 - ) { - maxChartVal = highestwpm + 15; + "PB: " + lpb; + if (maxChartVal >= lpb - 15 && maxChartVal <= lpb + 15) { + maxChartVal = lpb + 15; } wpmOverTimeChart.options.scales.yAxes[0].ticks.max = Math.round( maxChartVal