From de986c445eef624c3295e950021744f855b9fe38 Mon Sep 17 00:00:00 2001 From: 0neGal Date: Sat, 21 May 2022 21:15:22 +0200 Subject: fixed packages being filtered when they shouldn't Previously packages were filtered based on whether Browser.filters.get().filtered included any of the categories, now however it only checks if one of 4 filters is selected, Skins, Mods, Client-side and Server-side, anything beyond that like "Language: EN" is ignored and unless it doesn't have any of the other filters selected it'll go unfiltered. Previously when selecting every filter you'd still only get 100'ish packages at best, now you get the full 150 that there currently is on Thunderstore, except for r2modman and Northstar itself. --- src/app/browser.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/app/browser.js b/src/app/browser.js index b653e48..a292cf6 100644 --- a/src/app/browser.js +++ b/src/app/browser.js @@ -9,12 +9,16 @@ var Browser = { filters: { getpkgs: () => { let pkgs = []; + let other = []; for (let i in packages) { if (! Browser.filters.isfiltered(packages[i].categories)) { pkgs.push(packages[i]); + } else { + other.push(packages[i]); } } + console.log(other) return pkgs; }, get: () => { @@ -39,6 +43,19 @@ var Browser = { let filtered = Browser.filters.get().filtered; let unfiltered = Browser.filters.get().unfiltered; let state = false; + + let filters = [ + "Mods", "Skins", + "Client-side", "Server-side", + ]; + + let newcategories = []; + for (let i = 0; i < categories.length; i++) { + if (filters.includes(categories[i])) { + newcategories.push(categories[i]); + } + }; categories = newcategories; + if (categories.length == 0) {return true} for (let i = 0; i < categories.length; i++) { if (filtered.includes(categories[i])) { -- cgit v1.2.3