mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-05-21 09:09:09 -05:00
fix conditional inloop for uptime duration
This commit is contained in:
@@ -56,7 +56,7 @@ const calculateUptimeDuration = (checks) => {
|
||||
const latestCheck = new Date(checks[0].createdAt);
|
||||
let latestDownCheck = 0;
|
||||
|
||||
for (let i = checks.length; i >= 0; i--) {
|
||||
for (let i = checks.length - 1; i >= 0; i--) {
|
||||
if (checks[i].status === false) {
|
||||
latestDownCheck = new Date(checks[i].createdAt);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user