Fix sorting by name for player-markers

This commit is contained in:
Lukas Rieger (Blue) 2023-02-11 10:38:21 +01:00
parent 310a2e55eb
commit 9c4bcc100f
No known key found for this signature in database
GPG Key ID: 2D09EC5ED2687FF2
1 changed files with 4 additions and 2 deletions

View File

@ -58,8 +58,10 @@ export default {
return marker.type === "player" && (marker.name.includesCI(this.filter.search) || marker.playerUuid.includesCI(this.filter.search));
}).sort((a, b) => {
if (this.filter.order === "label") {
if (a.label < b.label) return -1;
if (a.label > b.label) return 1;
let la = a.type === "player" ? a.name : a.label;
let lb = b.type === "player" ? b.name : b.label;
if (la < lb) return -1;
if (la > lb) return 1;
return 0;
}
if (this.filter.order === "distance") {