From 8659c2f089b85d68076ffaa1504e984258ec1bd2 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Tue, 26 Sep 2023 13:36:48 +0200 Subject: [PATCH] appstore: fix popularity sorting --- store/templates/catalog.html | 2 +- store/templates/wishlist.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/store/templates/catalog.html b/store/templates/catalog.html index eade21b..e80221d 100644 --- a/store/templates/catalog.html +++ b/store/templates/catalog.html @@ -239,7 +239,7 @@ } else if (sortBy === "popularity") { toSort.sort(function(a, b) { - return a.dataset.stars < b.dataset.stars ? 1 : -1; + return parseInt(a.dataset.stars) < parseInt(b.dataset.stars) ? 1 : -1; }); } else if (sortBy === "") { diff --git a/store/templates/wishlist.html b/store/templates/wishlist.html index 3aca66a..d1722f7 100644 --- a/store/templates/wishlist.html +++ b/store/templates/wishlist.html @@ -211,7 +211,7 @@ } else if (sortBy === "popularity") { toSort.sort(function(a, b) { - return a.dataset.stars < b.dataset.stars ? 1 : -1; + return parseInt(a.dataset.stars) < parseInt(b.dataset.stars) ? 1 : -1; }); } else if (sortBy === "") {