Skip to content

Commit

Permalink
Merge pull request #6807 from Ocelot-Social-Community/6794-fix-filter…
Browse files Browse the repository at this point in the history
…s-if-categories-switched-off

fix(webapp): make filter menu visible if categories are inactive
  • Loading branch information
Tirokk authored Oct 31, 2023
2 parents 0e21c73 + 941d877 commit 7c0a825
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
28 changes: 15 additions & 13 deletions webapp/components/FilterMenu/FilterMenuComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="filter-menu-options">
<div class="filter-header">
<h2 class="title">{{ $t('filter-menu.filter-by') }}</h2>
<div class="item-save-topics">
<div v-if="categoriesActive" class="item-save-topics">
<labeled-button
filled
:label="$t('actions.saveCategories')"
Expand Down Expand Up @@ -62,18 +62,20 @@ export default {
},
methods: {
saveCategories() {
this.$apollo
.mutate({
mutation: SaveCategories(),
variables: { activeCategories: this.filteredCategoryIds },
})
.then(() => {
this.$emit('showFilterMenu')
this.$toast.success(this.$t('filter-menu.save.success'))
})
.catch(() => {
this.$toast.error(this.$t('filter-menu.save.error'))
})
if (this.categoriesActive) {
this.$apollo
.mutate({
mutation: SaveCategories(),
variables: { activeCategories: this.filteredCategoryIds },
})
.then(() => {
this.$emit('showFilterMenu')
this.$toast.success(this.$t('filter-menu.save.success'))
})
.catch(() => {
this.$toast.error(this.$t('filter-menu.save.error'))
})
}
},
},
}
Expand Down
2 changes: 1 addition & 1 deletion webapp/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</client-only>
</div>
<div>
<div v-if="categoriesActive && SHOW_CONTENT_FILTER_MASONRY_GRID" class="top-filter-menu">
<div v-if="SHOW_CONTENT_FILTER_MASONRY_GRID" class="top-filter-menu">
<div class="filterButtonBox">
<div class="filterButtonMenu" :class="{ 'hide-filter': hideByScroll }">
<base-button
Expand Down

0 comments on commit 7c0a825

Please sign in to comment.