add manual sorting to unit cards

This commit is contained in:
NilsUeter
2025-04-27 17:20:45 +02:00
parent 0578503235
commit 7949218076
3 changed files with 102 additions and 36 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ export const ShortSummaryTable = ({ force, primaryColor, name, points }) => {
const [hide, setHide] = useState(false);
const { units, factionRules, rules, catalog } = force;
const sortedUnits = units.sort((a, b) => {
const sortedUnits = units.slice().sort((a, b) => {
// sort by points cost desc first, then by name
if (a.cost.points < b.cost.points) return 1;
if (a.cost.points > b.cost.points) return -1;