Hide Invites menu item if invites are disabled

This commit is contained in:
Angelina Filippova 2020-04-05 16:58:54 +03:00
parent 9010cbbf3f
commit d0af7e4907

View file

@ -1,5 +1,5 @@
<template>
<div v-if="!item.hidden&&item.children" class="menu-wrapper">
<div v-if="!item.hidden && item.children && invitesEnabled" class="menu-wrapper">
<template v-if="hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow">
<app-link :to="resolvePath(onlyOneChild.path)">
@ -68,6 +68,11 @@ export default {
onlyOneChild: null
}
},
computed: {
invitesEnabled() {
return this.basePath === '/invites' ? this.$store.state.app.invitesEnabled : true
}
},
methods: {
hasOneShowingChild(children, parent) {
const showingChildren = children.filter(item => {