From d5236f31e25216fc43b298bc1398d53404f38e96 Mon Sep 17 00:00:00 2001 From: Luke Berndt Date: Sun, 1 Sep 2024 10:22:10 -0400 Subject: [PATCH] more debug --- frontend/src/System/ListSystems.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/frontend/src/System/ListSystems.js b/frontend/src/System/ListSystems.js index 757ad21..da6536a 100644 --- a/frontend/src/System/ListSystems.js +++ b/frontend/src/System/ListSystems.js @@ -48,9 +48,13 @@ const ListSystems = (props) => { } let popularSystems = []; - if (isSuccess && systems.systems) - popularSystems = systems.systems.sort((a, b) => b.clientCount - a.clientCount).slice(0, 4); - + if (isSuccess && systems.systems) { + const sortedSystems = systems.systems.sort((a, b) => { + + return b.clientCount - a.clientCount; + }); + popularSystems = sortedSystems.slice(0, 4); + } const handleContactClick = (system) => { setContactSystem(system); setContactVisible(true);