fix: default order

This commit is contained in:
TrèsAbhi committed 2024-02-09 19:43:02 -06:00
1 parent 31936d6e6c
commit 8c25037cb8
1 file changed
+10 -4
@@ -63,14 +63,20 @@ export function TankSearch({ compact, onSelect = () => {} }: TankSearchProps) {
awaitedTanks awaitedTanks
.sort( .sort(
(a, b) => (a, b) =>
treeTypeOrder.indexOf(a.treeType) - (treeTypeOrder.indexOf(a.treeType) -
treeTypeOrder.indexOf(b.treeType), treeTypeOrder.indexOf(b.treeType)) *
(sort.direction === 'descending' ? -1 : 1),
) )
.sort( .sort(
(a, b) => (a, b) =>
tankTypeOrder.indexOf(a.type) - tankTypeOrder.indexOf(b.type), (tankTypeOrder.indexOf(a.type) - tankTypeOrder.indexOf(b.type)) *
(sort.direction === 'descending' ? -1 : 1),
) )
.sort((a, b) => nations.indexOf(a.nation) - nations.indexOf(b.nation)), .sort(
(a, b) =>
(nations.indexOf(a.nation) - nations.indexOf(b.nation)) *
(sort.direction === 'descending' ? -1 : 1),
),
[], [],
); );
const input = useRef<HTMLInputElement>(null); const input = useRef<HTMLInputElement>(null);