forked from platypush/platypush
[Media UI] Don't display the torrent menu entry if no torrent plugin is enabled.
This commit is contained in:
parent
5ef7313bdc
commit
deaedf2462
2 changed files with 19 additions and 3 deletions
|
@ -8,7 +8,9 @@
|
|||
@seek="seek" @search="search" @mute="toggleMute" @unmute="toggleMute">
|
||||
<main>
|
||||
<div class="nav-container from tablet" :style="navContainerStyle">
|
||||
<Nav :selected-view="selectedView" @input="selectedView = $event"
|
||||
<Nav :selected-view="selectedView"
|
||||
:torrent-plugin="torrentPlugin"
|
||||
@input="selectedView = $event"
|
||||
@toggle="forceShowNav = !forceShowNav" />
|
||||
</div>
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<i class="fa fa-bars" />
|
||||
</button>
|
||||
|
||||
<li v-for="(view, name) in views" :key="name" :title="view.displayName"
|
||||
<li v-for="(view, name) in displayedViews" :key="name" :title="view.displayName"
|
||||
:class="{selected: name === selectedView}" @click="$emit('input', name)">
|
||||
<i :class="view.iconClass" />
|
||||
</li>
|
||||
|
@ -24,6 +24,10 @@ export default {
|
|||
default: false,
|
||||
},
|
||||
|
||||
torrentPlugin: {
|
||||
type: String,
|
||||
},
|
||||
|
||||
views: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
|
@ -46,6 +50,16 @@ export default {
|
|||
}
|
||||
},
|
||||
},
|
||||
|
||||
computed: {
|
||||
displayedViews() {
|
||||
const views = {...this.views}
|
||||
if (!this.torrentPlugin?.length)
|
||||
delete views.torrents
|
||||
|
||||
return views
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Reference in a new issue