From a5e243056dc07ec06fd2f9236b30412b3a459904 Mon Sep 17 00:00:00 2001 From: "Patrik J. Braun" Date: Fri, 1 Dec 2023 20:03:29 +0100 Subject: [PATCH] Fixing filter sorting --- src/frontend/app/ui/gallery/filter/filter.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/app/ui/gallery/filter/filter.service.ts b/src/frontend/app/ui/gallery/filter/filter.service.ts index 89074eaf..220483e1 100644 --- a/src/frontend/app/ui/gallery/filter/filter.service.ts +++ b/src/frontend/app/ui/gallery/filter/filter.service.ts @@ -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);