From fd77a4bd6b255260d0f4cad11947b38f4d30030e Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Mon, 7 Aug 2023 13:29:54 -0700 Subject: feat: :children_crossing: sort history by reverse date --- extension/react-app/src/pages/history.tsx | 54 ++++++++++++++++--------------- 1 file changed, 28 insertions(+), 26 deletions(-) (limited to 'extension/react-app') diff --git a/extension/react-app/src/pages/history.tsx b/extension/react-app/src/pages/history.tsx index c3240a66..edf4d39f 100644 --- a/extension/react-app/src/pages/history.tsx +++ b/extension/react-app/src/pages/history.tsx @@ -59,32 +59,34 @@ function History() { - {sessions.map((session, index) => ( - - - - ))} + {sessions + .sort((a, b) => parseInt(b.date_created) - parseInt(a.date_created)) + .map((session, index) => ( + + + + ))}
- { - client?.loadSession(session.session_id); - navigate("/"); - }} - > -
{session.title}
-
- {new Date( - parseInt(session.date_created) * 1000 - ).toLocaleString("en-US", { - weekday: "short", - year: "numeric", - month: "long", - day: "numeric", - hour: "numeric", - minute: "numeric", - })} -
-
-
+ { + client?.loadSession(session.session_id); + navigate("/"); + }} + > +
{session.title}
+
+ {new Date( + parseInt(session.date_created) * 1000 + ).toLocaleString("en-US", { + weekday: "short", + year: "numeric", + month: "long", + day: "numeric", + hour: "numeric", + minute: "numeric", + })} +
+
+

-- cgit v1.2.3-70-g09d2