Fix:Close playback when logging out

This commit is contained in:
advplyr 2022-04-26 16:46:29 -05:00
parent 72f10e5f42
commit d64dd63ea4
3 changed files with 7 additions and 5 deletions

View file

@ -18,8 +18,8 @@
<widgets-download-progress-indicator />
<!-- Must be connected to a server to cast, only supports media items on server -->
<div v-show="isCastAvailable && user" class="mx-2 cursor-pointer">
<span class="material-icons" :class="isCasting ? 'text-success' : ''" style="font-size: 1.75rem" @click="castClick">cast</span>
<div v-show="isCastAvailable && user" class="mx-2 cursor-pointer mt-1">
<span class="material-icons" :class="isCasting ? 'text-success' : ''" style="font-size: 1.6rem" @click="castClick">cast</span>
</div>
<nuxt-link v-if="user" class="h-7 mx-2" to="/search">

View file

@ -634,6 +634,11 @@ export default {
this.$nextTick(this.init)
},
beforeDestroy() {
if (this.playbackSession) {
console.log('[AudioPlayer] Before destroy closing playback')
this.closePlayback()
}
this.forceCloseDropdownMenu()
document.body.removeEventListener('touchstart', this.touchstart)
document.body.removeEventListener('touchend', this.touchend)

View file

@ -21,9 +21,6 @@ export const state = () => ({
})
export const getters = {
playerIsOpen: (state) => {
return state.streamAudiobook
},
getIsItemStreaming: state => libraryItemId => {
return state.playerLibraryItemId == libraryItemId
},