1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00

Fixing filter sorting

This commit is contained in:
Patrik J. Braun 2023-12-01 20:03:29 +01:00
parent ba9b5292e1
commit a5e243056d

View File

@ -340,7 +340,7 @@ export class FilterService {
.filter((o) => o.count > 0)
// sort by count and alpha. if counts are the same
.sort((a, b) =>
a.count == b.count ?
a.count == b.count && (a.name !== undefined && b.name !== undefined) ?
Number.isFinite(a.name) && Number.isFinite(b.name) ? (a.name as number) - (b.name as number) : a.name.toString().localeCompare(b.name.toString()) :
b.count - a.count);