Enable active and local filters on users tab by default

This commit is contained in:
Angelina Filippova 2020-07-28 21:04:21 +03:00
parent ca3745e237
commit 065efcab7f

View file

@ -21,7 +21,7 @@
export default {
data() {
return {
value: []
value: ['local', 'active']
}
},
computed: {
@ -29,6 +29,10 @@ export default {
return this.$store.state.app.device === 'desktop'
}
},
created() {
const currentFilters = this.$data.value.reduce((acc, filter) => ({ ...acc, [filter]: true }), {})
this.$store.dispatch('ToggleUsersFilter', currentFilters)
},
methods: {
removeOppositeFilters() {
const filtersQuantity = Object.keys(this.$store.state.users.filters).length