aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2022-05-21 21:15:22 +0200
committer0neGal <mail@0negal.com>2022-05-21 21:15:22 +0200
commitde986c445eef624c3295e950021744f855b9fe38 (patch)
tree07bd416a47d87dff5bd094bba05c60f9244592e0 /src
parent34be329370ae8e39df260e366c4128f9a5d79b78 (diff)
downloadViper-de986c445eef624c3295e950021744f855b9fe38.tar.gz
Viper-de986c445eef624c3295e950021744f855b9fe38.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/app/browser.js17
1 files changed, 17 insertions, 0 deletions
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])) {