Skip to content

Commit

Permalink
feat: add branding to the window title (#1850)
Browse files Browse the repository at this point in the history
  • Loading branch information
newhinton committed Mar 24, 2022
1 parent fca5fc5 commit f8dfbf7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions frontend/src/router/index.js
Expand Up @@ -12,7 +12,7 @@ import ProfileSettings from "@/views/settings/Profile";
import Shares from "@/views/settings/Shares";
import Errors from "@/views/Errors";
import store from "@/store";
import { baseURL } from "@/utils/constants";
import { baseURL, name } from "@/utils/constants";

Vue.use(Router);

Expand All @@ -29,7 +29,7 @@ const router = new Router({
return next({ path: "/files" });
}

document.title = "Login";
document.title = "Login - " + name;
next();
},
},
Expand Down Expand Up @@ -140,7 +140,7 @@ const router = new Router({
});

router.beforeEach((to, from, next) => {
document.title = to.name;
document.title = to.name + " - " + name;

if (to.matched.some((record) => record.meta.requiresAuth)) {
if (!store.getters.isLogged) {
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/views/Files.vue
Expand Up @@ -28,6 +28,7 @@ import Breadcrumbs from "@/components/Breadcrumbs";
import Errors from "@/views/Errors";
import Preview from "@/views/files/Preview";
import Listing from "@/views/files/Listing";
import { name } from "@/utils/constants";
function clean(path) {
return path.endsWith("/") ? path.slice(0, -1) : path;
Expand All @@ -51,6 +52,7 @@ export default {
},
computed: {
...mapState(["req", "reload", "loading", "show"]),
name: () => name,
currentView() {
if (this.req.type == undefined) {
return null;
Expand Down Expand Up @@ -116,7 +118,7 @@ export default {
}
this.$store.commit("updateRequest", res);
document.title = `${res.name} - ${this.$route.name}`;
document.title = `${res.name} - ${this.$route.name} - ${this.name}`;
} catch (e) {
this.error = e;
} finally {
Expand Down

0 comments on commit f8dfbf7

Please sign in to comment.