diff --git a/ayanova/src/App.vue b/ayanova/src/App.vue index d27575a6..09ba5908 100644 --- a/ayanova/src/App.vue +++ b/ayanova/src/App.vue @@ -140,7 +140,7 @@ export default { ] }; }, - mounted() { + created() { //subscribe to context menu changes var that = this; this.$gzevent.$on("context-menu-change", function(ctx) { @@ -155,7 +155,11 @@ export default { this.$gzevent.$on("context-click", function(key) { alert("App.vue::context click: " + key); }); - + }, + beforeDestroy() { + this.$gzevent.$off(); + }, + mounted() { //redirect to login if not authenticated if (!this.$store.state.authenticated) { this.$router.replace({ name: "login" });