From 556d8302d4c82d893211e7904c308292cd39816b Mon Sep 17 00:00:00 2001 From: Stian Aune Date: Thu, 7 Nov 2019 21:12:29 +0100 Subject: [PATCH] Warmup fix. --- contentScript.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/contentScript.js b/contentScript.js index 14fc67f..7036989 100644 --- a/contentScript.js +++ b/contentScript.js @@ -395,8 +395,9 @@ if (typeof Overlay === "undefined") { } // Post-warmup - const trainedMinutes = minutes - warmupMin; - const postWarmup = Math.round((cpm * (trainedMinutes + (seconds / 60)))); + const trainedMinutes = Math.min(minutes - warmupMin); + const trainedSeconds = minutes >= warmupMin ? seconds : 0; + const postWarmup = Math.round((cpm * (trainedMinutes + (trainedSeconds / 60)))); // Sum return Math.round(preWarmup + postWarmup);