From eaa3619a4545a1699a0364ed6c537387e4085f21 Mon Sep 17 00:00:00 2001 From: Ash Keel Date: Fri, 27 Jan 2023 00:28:43 +0100 Subject: [PATCH] fix: use event date for sorting recent events --- frontend/src/ui/pages/Dashboard.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/ui/pages/Dashboard.tsx b/frontend/src/ui/pages/Dashboard.tsx index a700b28..ac46ce4 100644 --- a/frontend/src/ui/pages/Dashboard.tsx +++ b/frontend/src/ui/pages/Dashboard.tsx @@ -335,7 +335,6 @@ function TwitchEvent({ data }: { data: EventSubNotification }) { function TwitchEventLog({ events }: { events: EventSubNotification[] }) { const { t } = useTranslation(); - console.log(events); return ( <> @@ -351,7 +350,9 @@ function TwitchEventLog({ events }: { events: EventSubNotification[] }) { {events .filter((ev) => supportedMessages.includes(ev.subscription.type)) - .reverse() + .sort((a, b) => + a.date && b.date ? Date.parse(b.date) - Date.parse(a.date) : 0, + ) .map((ev) => ( ))}