mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-12-25 21:29:37 +00:00
Fix: Always re-load libraries when changing users #4694
Some checks are pending
CodeQL / Analyze (push) Waiting to run
Run Component Tests / Run Component Tests (push) Waiting to run
Build and Push Docker Image / build (push) Waiting to run
Integration Test / build and test (push) Waiting to run
Run Unit Tests / Run Unit Tests (push) Waiting to run
Some checks are pending
CodeQL / Analyze (push) Waiting to run
Run Component Tests / Run Component Tests (push) Waiting to run
Build and Push Docker Image / build (push) Waiting to run
Integration Test / build and test (push) Waiting to run
Run Unit Tests / Run Unit Tests (push) Waiting to run
This commit is contained in:
parent
37beb7b37c
commit
2592467d09
2 changed files with 4 additions and 3 deletions
|
|
@ -189,6 +189,7 @@ export default {
|
|||
require('@/plugins/chromecast.js').default(this)
|
||||
}
|
||||
|
||||
this.$store.commit('libraries/setLastLoad', 0) // Ensure libraries get loaded again when switching users
|
||||
this.$store.commit('libraries/setCurrentLibrary', { id: userDefaultLibraryId })
|
||||
this.$store.commit('user/setUser', user)
|
||||
// Access token only returned from login, not authorize
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ export const actions = {
|
|||
.$get(`/api/libraries`)
|
||||
.then((data) => {
|
||||
commit('set', data.libraries)
|
||||
commit('setLastLoad')
|
||||
commit('setLastLoad', new Date())
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Failed', error)
|
||||
|
|
@ -176,8 +176,8 @@ export const mutations = {
|
|||
setFoldersLastUpdate(state) {
|
||||
state.folderLastUpdate = Date.now()
|
||||
},
|
||||
setLastLoad(state) {
|
||||
state.lastLoad = Date.now()
|
||||
setLastLoad(state, date) {
|
||||
state.lastLoad = date
|
||||
},
|
||||
setLibraryIssues(state, val) {
|
||||
state.issues = val
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue