From ae027f1c90f6fc8db5f4bc25bb15485e4ea9e052 Mon Sep 17 00:00:00 2001 From: absidue <48293849+absidue@users.noreply.github.com> Date: Tue, 9 Apr 2024 03:16:51 +0200 Subject: [PATCH] Fix window title displaying null while loading a video or channel (#4913) --- src/renderer/App.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/renderer/App.js b/src/renderer/App.js index 380655809..cec35685d 100644 --- a/src/renderer/App.js +++ b/src/renderer/App.js @@ -78,14 +78,13 @@ export default defineComponent({ return this.$store.getters.getShowCreatePlaylistPrompt }, windowTitle: function () { - const routeName = this.$route.name - if (routeName !== 'channel' && routeName !== 'watch' && routeName !== 'hashtag') { - let title = - this.$route.meta.path === '/home' - ? packageDetails.productName - : `${translateWindowTitle(this.$route.meta.title, this.$i18n)} - ${packageDetails.productName}` + const routePath = this.$route.path + if (!routePath.startsWith('/channel/') && !routePath.startsWith('/watch/') && !routePath.startsWith('/hashtag/')) { + let title = translateWindowTitle(this.$route.meta.title, this.$i18n) if (!title) { title = packageDetails.productName + } else { + title = `${title} - ${packageDetails.productName}` } return title } else {