From e77609ed57a3361d7958542a79939389eb4cd54e Mon Sep 17 00:00:00 2001 From: wommy Date: Tue, 24 Sep 2024 02:59:35 -0400 Subject: [PATCH] init runtime.public ;; cleared up misc errors --- client/components/app/ConfigSideNav.vue | 4 ++-- client/components/app/SideRail.vue | 2 +- client/components/covers/AuthorImage.vue | 3 +-- client/components/modals/ShareModal.vue | 5 ++--- client/components/modals/player/QueueItemRow.vue | 4 ++-- client/layouts/default.vue | 2 +- client/nuxt.config.js | 8 +++++--- client/pages/config/rss-feeds.vue | 2 +- client/pages/share/_slug.vue | 3 +-- client/plugins/init.client.js | 2 +- 10 files changed, 17 insertions(+), 18 deletions(-) diff --git a/client/components/app/ConfigSideNav.vue b/client/components/app/ConfigSideNav.vue index adc99e5ae..9efa5b07b 100644 --- a/client/components/app/ConfigSideNav.vue +++ b/client/components/app/ConfigSideNav.vue @@ -15,11 +15,11 @@
- +

{{ Source }}

- Latest: {{ $config.version }} + Latest: {{ $config.public.version }}
diff --git a/client/components/app/SideRail.vue b/client/components/app/SideRail.vue index dbbc4d266..58a133f3c 100644 --- a/client/components/app/SideRail.vue +++ b/client/components/app/SideRail.vue @@ -116,7 +116,7 @@
-

v{{ $config.version }}

+

v{{ $config.public.version }}

Update

{{ Source }}

diff --git a/client/components/covers/AuthorImage.vue b/client/components/covers/AuthorImage.vue index 019263633..dd4383bc4 100644 --- a/client/components/covers/AuthorImage.vue +++ b/client/components/covers/AuthorImage.vue @@ -55,8 +55,7 @@ export default { return this._author.updatedAt }, imgSrc() { - if (!this.imagePath) return null - return `${this.$config.routerBasePath}/api/authors/${this.authorId}/image?token=${this.userToken}&ts=${this.updatedAt}` + return this.imagePath ? `${this.$config.public.routerBasePath}/api/authors/${this.authorId}/image?token=${this.userToken}&ts=${this.updatedAt}` : null } }, methods: { diff --git a/client/components/modals/ShareModal.vue b/client/components/modals/ShareModal.vue index d0487fd38..9d73c50d6 100644 --- a/client/components/modals/ShareModal.vue +++ b/client/components/modals/ShareModal.vue @@ -112,11 +112,10 @@ export default { return this.$store.state.user.user }, demoShareUrl() { - return `${window.origin}${this.$config.routerBasePath}/share/${this.newShareSlug}` + return `${window.origin}${this.$config.public.routerBasePath}/share/${this.newShareSlug}` }, currentShareUrl() { - if (!this.currentShare) return '' - return `${window.origin}${this.$config.routerBasePath}/share/${this.currentShare.slug}` + return this.currentShare ? `${window.origin}${this.$config.public.routerBasePath}/share/${this.currentShare.slug}` : '' }, currentShareTimeRemaining() { if (!this.currentShare) return 'Error' diff --git a/client/components/modals/player/QueueItemRow.vue b/client/components/modals/player/QueueItemRow.vue index 31f49aa9c..a067075cc 100644 --- a/client/components/modals/player/QueueItemRow.vue +++ b/client/components/modals/player/QueueItemRow.vue @@ -55,7 +55,7 @@ export default { return this.item.coverPath }, coverUrl() { - if (!this.coverPath) return `${this.$config.routerBasePath}/book_placeholder.jpg` + if (!this.coverPath) return `${this.$config.public.routerBasePath}/book_placeholder.jpg` return this.$store.getters['globals/getLibraryItemCoverSrcById'](this.libraryItemId) }, bookCoverAspectRatio() { @@ -99,4 +99,4 @@ export default { .queue-item-row-content { max-width: calc(100% - 48px - 128px); } - \ No newline at end of file + diff --git a/client/layouts/default.vue b/client/layouts/default.vue index 9121561e4..d8c5bfd2b 100644 --- a/client/layouts/default.vue +++ b/client/layouts/default.vue @@ -358,7 +358,7 @@ export default { transports: ['websocket'], upgrade: false, reconnection: true, - path: `${this.$config.routerBasePath}/socket.io` + path: `${this.$config.public.routerBasePath}/socket.io` }) this.$root.socket = this.socket console.log('Socket initialized') diff --git a/client/nuxt.config.js b/client/nuxt.config.js index afaad6df8..788655031 100644 --- a/client/nuxt.config.js +++ b/client/nuxt.config.js @@ -15,9 +15,11 @@ export default defineNuxtConfig({ }, telemetry: false, - publicRuntimeConfig: { - version: pkg.version, - routerBasePath + runtimeConfig: { + public: { + version: pkg.version, + routerBasePath + } }, // Global page headers: https://go.nuxtjs.dev/config-head diff --git a/client/pages/config/rss-feeds.vue b/client/pages/config/rss-feeds.vue index 68117a859..7375e30e3 100644 --- a/client/pages/config/rss-feeds.vue +++ b/client/pages/config/rss-feeds.vue @@ -125,7 +125,7 @@ export default { return this.$strings.LabelUnknown }, coverUrl(feed) { - if (!feed.coverPath) return `${this.$config.routerBasePath}/Logo.png` + if (!feed.coverPath) return `${this.$config.public.routerBasePath}/Logo.png` return `${feed.feedUrl}/cover` }, async loadFeeds() { diff --git a/client/pages/share/_slug.vue b/client/pages/share/_slug.vue index cd990072b..868470db7 100644 --- a/client/pages/share/_slug.vue +++ b/client/pages/share/_slug.vue @@ -60,8 +60,7 @@ export default { return this.mediaItemShare.playbackSession }, coverUrl() { - if (!this.playbackSession.coverPath) return `${this.$config.routerBasePath}/book_placeholder.jpg` - return `${this.$config.routerBasePath}/public/share/${this.mediaItemShare.slug}/cover` + return `${this.$config.public.routerBasePath}/${this.playbackSession.coverPath ? `public/share/${this.mediaItemShare.slug}/cover` : `book_placeholder.jpg`}` }, audioTracks() { return (this.playbackSession.audioTracks || []).map((track) => { diff --git a/client/plugins/init.client.js b/client/plugins/init.client.js index 984ec9d0d..74673a698 100644 --- a/client/plugins/init.client.js +++ b/client/plugins/init.client.js @@ -181,5 +181,5 @@ export default ({ app, store }, inject) => { inject('eventBus', new Vue()) inject('isDev', process.env.NODE_ENV !== 'production') - store.commit('setRouterBasePath', app.$config.routerBasePath) + store.commit('setRouterBasePath', app.$config.public.routerBasePath) }