Fix #864: Redirect from / to /library when user is logged in

This commit is contained in:
Eliot Berriot 2019-06-21 10:14:20 +02:00
parent 79ced9514a
commit 8308bc6a4d
No known key found for this signature in database
GPG Key ID: DD6965E2476E5C27
2 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1 @@
Redirect from / to /library when user is logged in (#864)

View File

@ -147,7 +147,19 @@ export default {
let msg = this.$pgettext('Content/Home/List item/Verb', 'Get quality metadata about your music thanks to <a href="%{ url }" target="_blank">MusicBrainz</a>')
return this.$gettextInterpolate(msg, {url: this.musicbrainzUrl})
}
},
watch: {
'$store.state.auth.authenticated': {
handler (v) {
if (v) {
console.log('Authenticated, redirecting to /library…')
this.$router.push('/library')
}
},
immediate: true
}
}
}
</script>