mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2026-08-26 05:14:09 +02:00
Fix:Set server settings after user logs in
This commit is contained in:
@@ -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))) {
|
||||
|
||||
Reference in New Issue
Block a user