From 065efcab7f757f3f4d20109e88909dd77c15f236 Mon Sep 17 00:00:00 2001 From: Angelina Filippova Date: Tue, 28 Jul 2020 21:04:21 +0300 Subject: [PATCH] Enable active and local filters on users tab by default --- src/views/users/components/UsersFilter.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/views/users/components/UsersFilter.vue b/src/views/users/components/UsersFilter.vue index 7b3bf55b..01bd384e 100644 --- a/src/views/users/components/UsersFilter.vue +++ b/src/views/users/components/UsersFilter.vue @@ -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