From 492042cf58bd40190aef87989390e15b58403874 Mon Sep 17 00:00:00 2001 From: Dreamacro <8615343+Dreamacro@users.noreply.github.com> Date: Tue, 3 Nov 2020 22:39:09 +0800 Subject: [PATCH] Fix: sort devices list --- src/containers/Connections/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/containers/Connections/index.tsx b/src/containers/Connections/index.tsx index 6ed3f79..71cda8e 100644 --- a/src/containers/Connections/index.tsx +++ b/src/containers/Connections/index.tsx @@ -126,7 +126,7 @@ export default function Connections() { ), [connections]) const devices = useMemo(() => { const gb = groupBy(connections, 'metadata.sourceIP') - return Object.keys(gb).map(key => ({ label: key, number: gb[key].length })) + return Object.keys(gb).map(key => ({ label: key, number: gb[key].length })).sort((a, b) => a.label.localeCompare(b.label)) }, [connections]) // table