Fix bug with running kvm-session after logout
Add listener that checks username in local storage every 10 seconds.
If it's empty, listener closes kvm console.
Change-Id: I3cde71f4dc9772cddcf3a2f00f6e49f4d78f8383
Signed-off-by: Konstantin Maskov <sulwirld@gmail.com>
diff --git a/src/layouts/AppLayout.vue b/src/layouts/AppLayout.vue
index 0b78e5b..25ba3f6 100644
--- a/src/layouts/AppLayout.vue
+++ b/src/layouts/AppLayout.vue
@@ -45,6 +45,12 @@
},
mounted() {
this.$root.$on('refresh-application', () => this.refresh());
+ setInterval(() => {
+ if (!localStorage.getItem('storedUsername')) {
+ this.$eventBus.$consoleWindow.close();
+ this.refresh();
+ }
+ }, 10000);
},
methods: {
refresh() {