Merge branch '245-admin-menu' into 'develop'
Resolve "Disappearing admin menu in the sidebar" Closes #245 See merge request funkwhale/funkwhale!245
This commit is contained in:
commit
a2f2226450
|
@ -0,0 +1 @@
|
|||
Fixed admin menu not showing after login (#245)
|
|
@ -272,7 +272,7 @@ export default {
|
|||
this.scrollToCurrent()
|
||||
}
|
||||
},
|
||||
'$store.state.availablePermissions': {
|
||||
'$store.state.auth.availablePermissions': {
|
||||
handler () {
|
||||
this.fetchNotificationsCount()
|
||||
},
|
||||
|
|
|
@ -79,8 +79,6 @@ export default {
|
|||
username: this.credentials.username,
|
||||
password: this.credentials.password
|
||||
}
|
||||
// We need to pass the component's this context
|
||||
// to properly make use of http in the auth service
|
||||
this.$store.dispatch('auth/login', {
|
||||
credentials,
|
||||
next: '/library',
|
||||
|
|
|
@ -25,7 +25,11 @@ export default {
|
|||
state.username = ''
|
||||
state.token = ''
|
||||
state.tokenData = {}
|
||||
state.availablePermissions = {}
|
||||
state.availablePermissions = {
|
||||
federation: false,
|
||||
library: false,
|
||||
upload: false
|
||||
}
|
||||
},
|
||||
profile: (state, value) => {
|
||||
state.profile = value
|
||||
|
@ -108,8 +112,8 @@ export default {
|
|||
commit('authenticated', true)
|
||||
commit('profile', data)
|
||||
commit('username', data.username)
|
||||
dispatch('favorites/fetch', null, {root: true})
|
||||
dispatch('playlists/fetchOwn', null, {root: true})
|
||||
dispatch('favorites/fetch', null, { root: true })
|
||||
dispatch('playlists/fetchOwn', null, { root: true })
|
||||
Object.keys(data.permissions).forEach(function (key) {
|
||||
// this makes it easier to check for permissions in templates
|
||||
commit('permission', {key, status: data.permissions[String(key)]})
|
||||
|
|
Loading…
Reference in New Issue