Got rid of sorting fx's since checks will come sorted from the backend.

This commit is contained in:
M M committed 2024-07-09 17:36:07 -07:00
1 parent 5481d3f161
commit 22f111cc66
1 file changed
-6
-6
View File
@@ -60,9 +60,6 @@ const DetailsPage = () => {
return 'N/A';
}
// Sort checks by createdAt descending to get the most recent check first
checks.sort((a, b) => new Date(b.createdAt) - new Date(a.createdAt));
const mostRecentCheck = checks[0];
const currentTime = new Date();
const lastCheckedTime = new Date(mostRecentCheck.createdAt);
@@ -90,9 +87,6 @@ const DetailsPage = () => {
return 'N/A'; // Handle case when no checks are available
}
// Sort checks by createdAt descending to get the most recent check first
checks.sort((a, b) => new Date(b.createdAt) - new Date(a.createdAt));
const mostRecentCheck = checks[0];
return new Date(mostRecentCheck.createdAt).toLocaleString();
};