From f09647d7541d58edbe0efd4fea4fb6f52f65f311 Mon Sep 17 00:00:00 2001 From: Alain Nussbaumer Date: Mon, 10 Jul 2023 12:19:34 +0200 Subject: [PATCH] [web] Use named route for the "now playing" page Switching to named routes in order to reduce future maintenance. --- web-src/src/components/NavbarBottom.vue | 4 ++-- web-src/src/router/index.js | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/web-src/src/components/NavbarBottom.vue b/web-src/src/components/NavbarBottom.vue index c113df55..5ca319e3 100644 --- a/web-src/src/components/NavbarBottom.vue +++ b/web-src/src/components/NavbarBottom.vue @@ -112,7 +112,7 @@ @@ -330,7 +330,7 @@ export default { return this.$store.getters.now_playing }, is_now_playing_page() { - return this.$route.path === '/now-playing' + return this.$route.name === 'now-playing' }, outputs() { return this.$store.state.outputs diff --git a/web-src/src/router/index.js b/web-src/src/router/index.js index 897c9ad7..8731398d 100644 --- a/web-src/src/router/index.js +++ b/web-src/src/router/index.js @@ -55,11 +55,6 @@ export const router = createRouter({ name: 'audiobook', path: '/audiobook/:id' }, - { - path: '/now-playing', - name: 'Now playing', - component: PageNowPlaying - }, { path: '/music', redirect: '/music/browse' @@ -148,6 +143,11 @@ export const router = createRouter({ component: PageComposerTracks, meta: { show_progress: true, has_index: true } }, + { + component: PageNowPlaying, + name: 'now-playing', + path: '/now-playing', + }, { component: PagePodcast, meta: { show_progress: true },