Fix window title displaying null while loading a video or channel (#4913)

This commit is contained in:
absidue 2024-04-09 03:16:51 +02:00 committed by GitHub
parent 97926d8c82
commit ae027f1c90
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 6 deletions

View File

@ -78,14 +78,13 @@ export default defineComponent({
return this.$store.getters.getShowCreatePlaylistPrompt return this.$store.getters.getShowCreatePlaylistPrompt
}, },
windowTitle: function () { windowTitle: function () {
const routeName = this.$route.name const routePath = this.$route.path
if (routeName !== 'channel' && routeName !== 'watch' && routeName !== 'hashtag') { if (!routePath.startsWith('/channel/') && !routePath.startsWith('/watch/') && !routePath.startsWith('/hashtag/')) {
let title = let title = translateWindowTitle(this.$route.meta.title, this.$i18n)
this.$route.meta.path === '/home'
? packageDetails.productName
: `${translateWindowTitle(this.$route.meta.title, this.$i18n)} - ${packageDetails.productName}`
if (!title) { if (!title) {
title = packageDetails.productName title = packageDetails.productName
} else {
title = `${title} - ${packageDetails.productName}`
} }
return title return title
} else { } else {