mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 10:47:04 +02:00
Fix: keep tank order stable on select
Tanks sharing the same tier, nation, class and type were shown in an arbitrary order that changed after selecting a tank. The meta sort had no tiebreaker, and the filtered list was sorted and reversed in place, so each re-sort started from the previous reversed order and flipped tied tanks around. - Added tank ID as the first sort key in `metaSortTank` so tied tanks always come out in the same order - Sorted a copy of the tank search results, pre-sorted by ID, instead of the cached list - Added an `exclude` option to tank search and used it in Compare so tanks already being compared can't be added again, including through select all or by swapping another slot Fixes #313
This commit is contained in:
1 parent
116c30be88
commit
273881c460
4 files changed
+28
-4
No files matched your search
@@ -12,6 +12,7 @@ export function metaSortTank(
|
||||
gameDefinitions: GameDefinitions,
|
||||
) {
|
||||
return tanks
|
||||
.sort((a, b) => a.id - b.id)
|
||||
.sort((a, b) => b.tier - a.tier)
|
||||
.sort(
|
||||
(a, b) => treeTypeOrder.indexOf(b.type) - treeTypeOrder.indexOf(a.type),
|
||||
|
||||
Reference in new issue
Block a user