Skip to content

A self-hosted media server and file management system

fix: attempt at fixing home page document title (let the page handle it and skip in the router)

aminnausinbada881b247b
diff --git a/resources/js/router/index.ts b/resources/js/router/index.ts
index 3ac55af9..258e4d19 100644
--- a/resources/js/router/index.ts
+++ b/resources/js/router/index.ts
@@ -174,7 +174,11 @@ const redirectAfterLogin = async (to: RouteLocationNormalizedGeneric, next: Navi
router.beforeEach(async (to, from, next) => {
const meta = to.meta as { title?: string };
- if (to.name !== 'logout') document.title = meta?.title ?? toTitleCase(`${to.name?.toString()}`); // Update Page Title
+ if (to?.name && ['logout', 'root', 'home'].indexOf(to.name.toString()) === -1) {
+ console.log('update title:', to.name, meta.title ?? '');
+
+ document.title = meta?.title ?? toTitleCase(`${to.name?.toString()}`); // Update Page Title
+ }
if (to.name === 'login' && !to.query.redirect && from.fullPath !== '/') {
// what does this do???
diff --git a/resources/js/views/VideoView.vue b/resources/js/views/VideoView.vue
index a9e116b9..348b81af 100755
--- a/resources/js/views/VideoView.vue
+++ b/resources/js/views/VideoView.vue
@@ -139,6 +139,7 @@ const setFolderAsPageTitle = () => {
const title = stateFolder.value?.series?.title ?? stateFolder?.value?.name;
if (!title) {
pageTitle.value = 'Folder not Found';
+ document.title = 'Folder not Found';
return;
}
pageTitle.value = title;