Skip to content

Commit f8dfbf7

Browse files
authored
feat: add branding to the window title (#1850)
1 parent fca5fc5 commit f8dfbf7

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

frontend/src/router/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import ProfileSettings from "@/views/settings/Profile";
1212
import Shares from "@/views/settings/Shares";
1313
import Errors from "@/views/Errors";
1414
import store from "@/store";
15-
import { baseURL } from "@/utils/constants";
15+
import { baseURL, name } from "@/utils/constants";
1616

1717
Vue.use(Router);
1818

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

32-
document.title = "Login";
32+
document.title = "Login - " + name;
3333
next();
3434
},
3535
},
@@ -140,7 +140,7 @@ const router = new Router({
140140
});
141141

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

145145
if (to.matched.some((record) => record.meta.requiresAuth)) {
146146
if (!store.getters.isLogged) {

frontend/src/views/Files.vue

+3-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import Breadcrumbs from "@/components/Breadcrumbs";
2828
import Errors from "@/views/Errors";
2929
import Preview from "@/views/files/Preview";
3030
import Listing from "@/views/files/Listing";
31+
import { name } from "@/utils/constants";
3132
3233
function clean(path) {
3334
return path.endsWith("/") ? path.slice(0, -1) : path;
@@ -51,6 +52,7 @@ export default {
5152
},
5253
computed: {
5354
...mapState(["req", "reload", "loading", "show"]),
55+
name: () => name,
5456
currentView() {
5557
if (this.req.type == undefined) {
5658
return null;
@@ -116,7 +118,7 @@ export default {
116118
}
117119
118120
this.$store.commit("updateRequest", res);
119-
document.title = `${res.name} - ${this.$route.name}`;
121+
document.title = `${res.name} - ${this.$route.name} - ${this.name}`;
120122
} catch (e) {
121123
this.error = e;
122124
} finally {

0 commit comments

Comments
 (0)