Fix formatting
This commit is contained in:
1 parent
6c0aea46a7
commit
162b081858
1 file changed
+6
-2
@@ -10,12 +10,16 @@ const PageSpeedStatusBoxes = ({ shouldRender, monitor }) => {
|
||||
// Calculate time since first check (checks since)
|
||||
const checks = monitor?.checks || [];
|
||||
const oldestCheck = checks.length > 0 ? checks[checks.length - 1] : null;
|
||||
const oldestCheckTime = oldestCheck?.createdAt ? new Date(oldestCheck.createdAt).getTime() : null;
|
||||
const oldestCheckTime = oldestCheck?.createdAt
|
||||
? new Date(oldestCheck.createdAt).getTime()
|
||||
: null;
|
||||
const checksSinceDuration = oldestCheckTime ? Date.now() - oldestCheckTime : 0;
|
||||
|
||||
// Calculate time since last check
|
||||
const latestCheck = checks.length > 0 ? checks[0] : null;
|
||||
const latestCheckTime = latestCheck?.createdAt ? new Date(latestCheck.createdAt).getTime() : null;
|
||||
const latestCheckTime = latestCheck?.createdAt
|
||||
? new Date(latestCheck.createdAt).getTime()
|
||||
: null;
|
||||
const lastCheckDuration = latestCheckTime ? Date.now() - latestCheckTime : 0;
|
||||
|
||||
const uptimeDuration = getHumanReadableDuration(checksSinceDuration);
|
||||
|
||||
Reference in new issue
Block a user