From a935fb02e287b96f6e16aa4f2b14dab1c3609cbc Mon Sep 17 00:00:00 2001 From: Firepup Sixfifty Date: Sat, 9 Nov 2024 00:04:19 +0000 Subject: [PATCH] Average should never be negative --- api/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/app.js b/api/app.js index 27571cc..be5c3cd 100644 --- a/api/app.js +++ b/api/app.js @@ -150,7 +150,7 @@ async function report() { "increase": diff, "start": oldest, }) - let averageSpeed = await getAverage(); + let averageSpeed = Math.max(0, await getAverage()); let pastThousandsGoal = Math.floor(latest / 1000) * 1000; let goals = predictSpeed(goalDate, goalNumber, latest); let message =