mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
fix: default order
This commit is contained in:
1 parent
31936d6e6c
commit
8c25037cb8
1 file changed
+10
-4
@@ -63,14 +63,20 @@ export function TankSearch({ compact, onSelect = () => {} }: TankSearchProps) {
|
||||
awaitedTanks
|
||||
.sort(
|
||||
(a, b) =>
|
||||
treeTypeOrder.indexOf(a.treeType) -
|
||||
treeTypeOrder.indexOf(b.treeType),
|
||||
(treeTypeOrder.indexOf(a.treeType) -
|
||||
treeTypeOrder.indexOf(b.treeType)) *
|
||||
(sort.direction === 'descending' ? -1 : 1),
|
||||
)
|
||||
.sort(
|
||||
(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);
|
||||
|
||||
Reference in new issue
Block a user