diff --git a/src/App.vue b/src/App.vue index 712ea29..b571b0f 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,12 +1,39 @@ - +import {mapState} from 'vuex'; + +export default { + name: "App", + data() { + return { + showWelcome: false + } + }, + computed: mapState('auth', ['name']), + mounted() { + this.$store.dispatch("auth/loadUserData").catch(() => { + this.$router.push({name: "Welcome"}); + }) + }, + watch: { + name(newValue, oldValue) { + if (oldValue === '') { + this.showWelcome = true; + } + } + } +} +