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
},
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 {