mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
- 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
32 lines
785 B
JavaScript
32 lines
785 B
JavaScript
export const state = () => {
|
|
return {
|
|
showFilterPostsDropdown: false,
|
|
filteredByUsersFollowed: false,
|
|
filteredByCategories: false,
|
|
}
|
|
}
|
|
|
|
export const getters = {
|
|
showFilterPostsDropdown(state) {
|
|
return state.showFilterPostsDropdown || false
|
|
},
|
|
filteredByUsersFollowed(state) {
|
|
return state.filteredByUsersFollowed || false
|
|
},
|
|
filteredByCategories(state) {
|
|
return state.filteredByCategories || false
|
|
},
|
|
}
|
|
|
|
export const mutations = {
|
|
SET_SHOW_FILTER_POSTS_DROPDOWN(state, boolean) {
|
|
state.showFilterPostsDropdown = boolean || null
|
|
},
|
|
SET_FILTERED_BY_FOLLOWERS(state, boolean) {
|
|
state.filteredByUsersFollowed = boolean || null
|
|
},
|
|
SET_FILTERED_BY_CATEGORIES(state, boolean) {
|
|
state.filteredByCategories = boolean || null
|
|
},
|
|
}
|