mirror of
https://github.com/openmhz/trunk-server.git
synced 2026-11-14 01:37:48 -05:00
ah - need to use toSorted so you don't mutate
This commit is contained in:
@@ -49,11 +49,7 @@ const ListSystems = (props) => {
|
|||||||
|
|
||||||
let popularSystems = [];
|
let popularSystems = [];
|
||||||
if (isSuccess && systems.systems) {
|
if (isSuccess && systems.systems) {
|
||||||
const sortedSystems = systems.systems.sort((a, b) => {
|
popularSystems = systems.systems.toSorted((a, b) => b.clientCount - a.clientCount).slice(0, 4);
|
||||||
|
|
||||||
return b.clientCount - a.clientCount;
|
|
||||||
});
|
|
||||||
popularSystems = sortedSystems.slice(0, 4);
|
|
||||||
}
|
}
|
||||||
const handleContactClick = (system) => {
|
const handleContactClick = (system) => {
|
||||||
setContactSystem(system);
|
setContactSystem(system);
|
||||||
|
|||||||
Reference in New Issue
Block a user