forked from AkkomaGang/admin-fe
Refactoring
This commit is contained in:
parent
3d7d026afe
commit
9c059c5887
1 changed files with 2 additions and 1 deletions
|
@ -35,12 +35,13 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
removeOppositeFilters() {
|
removeOppositeFilters() {
|
||||||
|
const filtersQuantity = Object.keys(this.$store.state.users.filters).length
|
||||||
const currentFilters = this.$data.value.slice()
|
const currentFilters = this.$data.value.slice()
|
||||||
const indexOfLocal = currentFilters.indexOf('local')
|
const indexOfLocal = currentFilters.indexOf('local')
|
||||||
const indexOfExternal = currentFilters.indexOf('external')
|
const indexOfExternal = currentFilters.indexOf('external')
|
||||||
const indexOfActive = currentFilters.indexOf('active')
|
const indexOfActive = currentFilters.indexOf('active')
|
||||||
const indexOfDeactivated = currentFilters.indexOf('deactivated')
|
const indexOfDeactivated = currentFilters.indexOf('deactivated')
|
||||||
if (currentFilters.length === 4) {
|
if (currentFilters.length === filtersQuantity) {
|
||||||
return []
|
return []
|
||||||
} else if (indexOfLocal > -1 && indexOfExternal > -1) {
|
} else if (indexOfLocal > -1 && indexOfExternal > -1) {
|
||||||
const filterToRemove = indexOfLocal > indexOfExternal ? indexOfExternal : indexOfLocal
|
const filterToRemove = indexOfLocal > indexOfExternal ? indexOfExternal : indexOfLocal
|
||||||
|
|
Loading…
Reference in a new issue