From deaedf2462742560caf27a8b052ab654532bc943 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Mon, 8 Jan 2024 22:25:10 +0100 Subject: [PATCH] [Media UI] Don't display the torrent menu entry if no torrent plugin is enabled. --- .../webapp/src/components/panels/Media/Index.vue | 6 ++++-- .../webapp/src/components/panels/Media/Nav.vue | 16 +++++++++++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/platypush/backend/http/webapp/src/components/panels/Media/Index.vue b/platypush/backend/http/webapp/src/components/panels/Media/Index.vue index 1505d9784d..cf47c32c16 100644 --- a/platypush/backend/http/webapp/src/components/panels/Media/Index.vue +++ b/platypush/backend/http/webapp/src/components/panels/Media/Index.vue @@ -8,8 +8,10 @@ @seek="seek" @search="search" @mute="toggleMute" @unmute="toggleMute">
diff --git a/platypush/backend/http/webapp/src/components/panels/Media/Nav.vue b/platypush/backend/http/webapp/src/components/panels/Media/Nav.vue index 93e370a405..cb912c68f4 100644 --- a/platypush/backend/http/webapp/src/components/panels/Media/Nav.vue +++ b/platypush/backend/http/webapp/src/components/panels/Media/Nav.vue @@ -4,7 +4,7 @@ -
  • @@ -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 + }, + }, }