Fix:Playlist tab not shown after adding first playlist #1092

This commit is contained in:
advplyr 2024-03-03 13:29:58 -06:00
parent c04c7a55d9
commit da3882fd5e
3 changed files with 10 additions and 8 deletions

View file

@ -48,11 +48,7 @@ class ServerSocket extends EventEmitter {
this.socket.on('init', this.onInit.bind(this))
this.socket.on('user_updated', this.onUserUpdated.bind(this))
this.socket.on('user_item_progress_updated', this.onUserItemProgressUpdated.bind(this))
// Good for testing socket requests
// this.socket.onAny((evt, args) => {
// console.log(`[SOCKET] onAny: ${this.socket.id}: ${evt} ${JSON.stringify(args)}`)
// })
this.socket.on('playlist_added', this.onPlaylistAdded.bind(this))
}
removeListeners() {
@ -93,6 +89,13 @@ class ServerSocket extends EventEmitter {
this.$store.commit('user/updateUserMediaProgress', payload.data)
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) => {