mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-07-18 01:35:08 +02:00
Fix:Set server settings after user logs in
This commit is contained in:
parent
db1d6da491
commit
7188089f63
4 changed files with 4 additions and 12 deletions
|
@ -285,14 +285,16 @@ export default {
|
|||
var payload = await this.requestServerLogin()
|
||||
this.processing = false
|
||||
if (payload) {
|
||||
this.setUserAndConnection(payload.user, payload.userDefaultLibraryId)
|
||||
this.setUserAndConnection(payload)
|
||||
}
|
||||
},
|
||||
async setUserAndConnection(user, userDefaultLibraryId) {
|
||||
async setUserAndConnection({ user, userDefaultLibraryId, serverSettings }) {
|
||||
if (!user) return
|
||||
|
||||
console.log('Successfully logged in', JSON.stringify(user))
|
||||
|
||||
this.$store.commit('setServerSettings', data.serverSettings)
|
||||
|
||||
// Set library - Use last library if set and available fallback to default user library
|
||||
var lastLibraryId = await this.$localStore.getLastLibraryId()
|
||||
if (lastLibraryId && (!user.librariesAccessible.length || user.librariesAccessible.includes(lastLibraryId))) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue