fix: wait with redirect until route name is available
This commit is contained in:
parent
60ef07da0f
commit
eec02a55a4
@ -27,12 +27,23 @@ export default {
|
||||
logoUrl,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.redirectToHome()
|
||||
computed: {
|
||||
routeName() {
|
||||
return this.$route.name
|
||||
},
|
||||
...mapState({
|
||||
motd: state => state.config.motd,
|
||||
}),
|
||||
},
|
||||
watch: {
|
||||
routeName: {
|
||||
handler(routeName) {
|
||||
if (!routeName) return
|
||||
this.redirectToHome()
|
||||
},
|
||||
immediate: true,
|
||||
},
|
||||
},
|
||||
computed: mapState({
|
||||
motd: state => state.config.motd,
|
||||
}),
|
||||
methods: {
|
||||
redirectToHome() {
|
||||
// Check if the user is already logged in and redirect them to the home page if not
|
||||
|
Loading…
x
Reference in New Issue
Block a user