mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2026-08-28 06:14:00 +02:00
Fix:Playlist tab not shown after adding first playlist #1092
This commit is contained in:
@@ -79,7 +79,7 @@ export default {
|
|||||||
return this.page
|
return this.page
|
||||||
},
|
},
|
||||||
hasFilter() {
|
hasFilter() {
|
||||||
if (this.page === 'series' || this.page === 'collections') return false
|
if (this.page === 'series' || this.page === 'collections' || this.page === 'playlists') return false
|
||||||
return this.filterBy !== 'all'
|
return this.filterBy !== 'all'
|
||||||
},
|
},
|
||||||
orderBy() {
|
orderBy() {
|
||||||
|
|||||||
+1
-2
@@ -212,8 +212,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
userUpdated(user) {
|
userUpdated(user) {
|
||||||
// console.log('[default] userUpdated:', JSON.stringify(user))
|
if (this.user?.id == user.id) {
|
||||||
if (this.user && this.user.id == user.id) {
|
|
||||||
this.$store.commit('user/setUser', user)
|
this.$store.commit('user/setUser', user)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
+8
-5
@@ -48,11 +48,7 @@ class ServerSocket extends EventEmitter {
|
|||||||
this.socket.on('init', this.onInit.bind(this))
|
this.socket.on('init', this.onInit.bind(this))
|
||||||
this.socket.on('user_updated', this.onUserUpdated.bind(this))
|
this.socket.on('user_updated', this.onUserUpdated.bind(this))
|
||||||
this.socket.on('user_item_progress_updated', this.onUserItemProgressUpdated.bind(this))
|
this.socket.on('user_item_progress_updated', this.onUserItemProgressUpdated.bind(this))
|
||||||
|
this.socket.on('playlist_added', this.onPlaylistAdded.bind(this))
|
||||||
// Good for testing socket requests
|
|
||||||
// this.socket.onAny((evt, args) => {
|
|
||||||
// console.log(`[SOCKET] onAny: ${this.socket.id}: ${evt} ${JSON.stringify(args)}`)
|
|
||||||
// })
|
|
||||||
}
|
}
|
||||||
|
|
||||||
removeListeners() {
|
removeListeners() {
|
||||||
@@ -93,6 +89,13 @@ class ServerSocket extends EventEmitter {
|
|||||||
this.$store.commit('user/updateUserMediaProgress', payload.data)
|
this.$store.commit('user/updateUserMediaProgress', payload.data)
|
||||||
this.emit('user_media_progress_updated', payload)
|
this.emit('user_media_progress_updated', payload)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onPlaylistAdded() {
|
||||||
|
// Currently numUserPlaylists is only used for showing the playlist tab or not. Precise number is not necessary
|
||||||
|
if (!this.$store.state.libraries.numUserPlaylists) {
|
||||||
|
this.$store.commit('libraries/setNumUserPlaylists', 1)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default ({ app, store }, inject) => {
|
export default ({ app, store }, inject) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user