aboutsummaryrefslogtreecommitdiff
path: root/src-vue/src/views
diff options
context:
space:
mode:
authorRémy Raes <contact@remyraes.com>2023-06-12 12:10:53 +0200
committerGitHub <noreply@github.com>2023-06-12 12:10:53 +0200
commit909deff6b876f1e4dae8822b726ae78174e29c79 (patch)
treec9a7d9fe940afbabc7126971d58981ca432c5f17 /src-vue/src/views
parentdbe198de950836d1ce0018409cfc6489bc6939db (diff)
downloadFlightCore-909deff6b876f1e4dae8822b726ae78174e29c79.tar.gz
FlightCore-909deff6b876f1e4dae8822b726ae78174e29c79.zip
fix: Hide deprecated mods in vanilla mods list (#390)
Diffstat (limited to 'src-vue/src/views')
-rw-r--r--src-vue/src/views/mods/ThunderstoreModsView.vue9
1 files changed, 7 insertions, 2 deletions
diff --git a/src-vue/src/views/mods/ThunderstoreModsView.vue b/src-vue/src/views/mods/ThunderstoreModsView.vue
index 6f5e8acf..7f70f03c 100644
--- a/src-vue/src/views/mods/ThunderstoreModsView.vue
+++ b/src-vue/src/views/mods/ThunderstoreModsView.vue
@@ -62,6 +62,9 @@ export default defineComponent({
this.$store.commit('fetchThunderstoreMods');
},
computed: {
+ showDeprecatedMods(): boolean {
+ return this.$store.state.search.showDeprecatedMods;
+ },
searchValue(): string {
return this.$store.getters.searchWords;
},
@@ -89,7 +92,7 @@ export default defineComponent({
);
// Filter out deprecated mods
- const showDeprecated = !mod.is_deprecated || this.$store.state.search.showDeprecatedMods;
+ const showDeprecated = !mod.is_deprecated || this.showDeprecatedMods;
// Filter with categories (only if some categories are selected)
const categoriesMatch: boolean = this.selectedCategories.length === 0
@@ -104,7 +107,9 @@ export default defineComponent({
// Use filtered mods if user is searching, vanilla list otherwise.
const mods: ThunderstoreMod[] = this.searchValue.length !== 0 || this.selectedCategories.length !== 0
? this.filteredMods
- : this.mods;
+ : this.showDeprecatedMods
+ ? this.mods
+ : this.mods.filter(mod => !mod.is_deprecated);
// Sort mods regarding user selected algorithm.
let compare: (a: ThunderstoreMod, b: ThunderstoreMod) => number;