From 1cd3ba907bcdbb308e5970edeb80a70d85fe1774 Mon Sep 17 00:00:00 2001 From: Matt Rider Date: Mon, 5 Aug 2019 14:39:45 +0200 Subject: [PATCH] Set vuex state to reset active button - when a user clicks on the logo or changes pages, the filter is reset, but the active button didn't update - still a bug with the active categoryIds since it's not so easy to set the state of an array in vuex - dry out code for toggleFilters - fix bug where user clicks on filter by users followed, then filters for categories of those users, then clicks to remove category filter --- webapp/components/FilterPosts/FilterPosts.vue | 2 +- .../FilterPosts/FilterPostsMenuItems.vue | 55 ++++++++++++------- webapp/layouts/default.vue | 6 +- webapp/pages/index.vue | 4 ++ webapp/store/default.js | 14 +++++ 5 files changed, 58 insertions(+), 23 deletions(-) diff --git a/webapp/components/FilterPosts/FilterPosts.vue b/webapp/components/FilterPosts/FilterPosts.vue index df05e67f7..10d333c90 100644 --- a/webapp/components/FilterPosts/FilterPosts.vue +++ b/webapp/components/FilterPosts/FilterPosts.vue @@ -48,7 +48,7 @@ export default { .query({ query: filterPosts(this.$i18n), variables: { - filter: filter, + filter, first: this.pageSize, offset: 0, }, diff --git a/webapp/components/FilterPosts/FilterPostsMenuItems.vue b/webapp/components/FilterPosts/FilterPostsMenuItems.vue index 709211da0..ffecf21a2 100644 --- a/webapp/components/FilterPosts/FilterPostsMenuItems.vue +++ b/webapp/components/FilterPosts/FilterPostsMenuItems.vue @@ -16,7 +16,7 @@ @@ -77,7 +77,7 @@ }" name="filter-by-followed-authors-only" icon="user-plus" - :primary="filteredByFollowers" + :primary="filteredByUsersFollowed" @click="toggleOnlyFollowed" /> @@ -93,6 +93,8 @@