From 22f111cc66be1d4bb31a47d876fde2bd472d7a14 Mon Sep 17 00:00:00 2001 From: M M Date: Tue, 9 Jul 2024 17:36:07 -0700 Subject: [PATCH] Got rid of sorting fx's since checks will come sorted from the backend. --- Client/src/Pages/Details/index.jsx | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Client/src/Pages/Details/index.jsx b/Client/src/Pages/Details/index.jsx index 55532a7af..c257077c1 100644 --- a/Client/src/Pages/Details/index.jsx +++ b/Client/src/Pages/Details/index.jsx @@ -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(); };