This commit is contained in:
2020-06-05 14:09:37 +00:00
parent 3dd037d38a
commit 4c3a2f8988
4 changed files with 17 additions and 10 deletions

View File

@@ -276,14 +276,15 @@ export default {
window.$gz.eventBus.$off();
},
mounted() {
// this.$vuetify.theme.dark = true;
this.$root.$gzconfirm = this.$refs.gzconfirm.open;
this.$root.$gznotify = this.$refs.gznotify.addNotification;
let vm = this;
vm.$vuetify.theme.dark = vm.$store.state.darkMode;
vm.$root.$gzconfirm = vm.$refs.gzconfirm.open;
vm.$root.$gznotify = vm.$refs.gznotify.addNotification;
//weird bastardization thing
//basically I want to access $gz in vue components where I can't access Window
//this smells bad but it works
this.$root.$gz = window.$gz;
vm.$root.$gz = window.$gz;
//Capture open object type and id if present
//localhost:8080/login?type=2&id=22
@@ -304,8 +305,8 @@ export default {
}
//redirect to login if not authenticated
if (!this.$store.state.authenticated) {
this.$router.push("login");
if (!vm.$store.state.authenticated) {
vm.$router.push("login");
} else {
//this can be safely called any time, it checks if there is an open object in store and
//opens it or if not just returns