switch to routerbased names for login&settings
This commit is contained in:
parent
f70f4a3700
commit
994c441a09
@ -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 as instancename } from "@/utils/constants";
|
||||
|
||||
Vue.use(Router);
|
||||
|
||||
@ -29,7 +29,7 @@ const router = new Router({
|
||||
return next({ path: "/files" });
|
||||
}
|
||||
|
||||
document.title = "Login";
|
||||
document.title = "Login - " + instancename;
|
||||
next();
|
||||
},
|
||||
},
|
||||
@ -140,7 +140,7 @@ const router = new Router({
|
||||
});
|
||||
|
||||
router.beforeEach((to, from, next) => {
|
||||
document.title = to.name;
|
||||
document.title = to.name + " - " + instancename;
|
||||
|
||||
if (to.matched.some((record) => record.meta.requiresAuth)) {
|
||||
if (!store.getters.isLogged) {
|
||||
|
||||
@ -69,7 +69,6 @@ export default {
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
window.document.title = window.document.title + " - " + name;
|
||||
if (!recaptcha) return;
|
||||
|
||||
window.grecaptcha.ready(function () {
|
||||
|
||||
@ -50,10 +50,9 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapMutations, mapState } from "vuex";
|
||||
import { mapState } from "vuex";
|
||||
|
||||
import HeaderBar from "@/components/header/HeaderBar";
|
||||
import { name } from "@/utils/constants";
|
||||
|
||||
export default {
|
||||
name: "settings",
|
||||
@ -64,22 +63,5 @@ export default {
|
||||
...mapState(["user", "loading"]),
|
||||
name: () => name,
|
||||
},
|
||||
created() {
|
||||
this.fetchData();
|
||||
},
|
||||
watch: {
|
||||
$route: "fetchData",
|
||||
reload: function (value) {
|
||||
if (value === true) {
|
||||
this.fetchData();
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(["setLoading"]),
|
||||
async fetchData() {
|
||||
document.title = document.title + ` - ${this.name}`;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user