Skip to content

A self-hosted media server and file management system

fix: code smell

aminnausinee5144655166
diff --git a/resources/js/router/index.ts b/resources/js/router/index.ts
index e97d9fd6..5f615431 100644
--- a/resources/js/router/index.ts
+++ b/resources/js/router/index.ts
@@ -204,7 +204,7 @@ router.beforeEach(async (to, from, next) => {
nProgress.start();
// If going to a route that isnt included in the list, set the page title to the route title
- if (to?.name && ['logout', 'root', 'home'].indexOf(to.name.toString()) === -1) {
+ if (to?.name && !['logout', 'root', 'home'].includes(to.name.toString())) {
document.title = meta.title ?? toTitleCase(`${to.name?.toString()}`); // Update Page Title
}
// Block logged in users if the route is guest-only