From 909deff6b876f1e4dae8822b726ae78174e29c79 Mon Sep 17 00:00:00 2001 From: Rémy Raes Date: Mon, 12 Jun 2023 12:10:53 +0200 Subject: fix: Hide deprecated mods in vanilla mods list (#390) --- src-vue/src/views/mods/ThunderstoreModsView.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src-vue') 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; -- cgit v1.2.3