From 50dc75b35fb38eb71d5fe203fd2fe8fd4782f97f Mon Sep 17 00:00:00 2001 From: dv Date: Wed, 6 May 2026 15:34:43 +0300 Subject: [PATCH] =?UTF-8?q?=D1=81=D0=BE=D1=80=D1=82=D0=B8=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=D0=BA=D0=B0=20=D0=B0=D0=BB=D0=B5=D1=80=D1=82=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/pages/Alerts.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/src/pages/Alerts.tsx b/frontend/src/pages/Alerts.tsx index 54f1c0e..672c32f 100644 --- a/frontend/src/pages/Alerts.tsx +++ b/frontend/src/pages/Alerts.tsx @@ -85,9 +85,11 @@ export function AlertsPage() { } map.get(key)!.alerts.push(a) } - return Array.from(map.values()).sort((a, b) => - (a.object_name ?? '').localeCompare(b.object_name ?? '', 'ru') - ) + return Array.from(map.values()).sort((a, b) => { + const latestA = Math.max(...a.alerts.map((x) => new Date(x.created_at).getTime())) + const latestB = Math.max(...b.alerts.map((x) => new Date(x.created_at).getTime())) + return latestB - latestA + }) }, [alerts]) const handleAcknowledge = async (id: number) => {