mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2026-08-26 05:14:09 +02:00
Fix:Android app crash when switching server while player open #1336
- Wrap requests in try/catch to prevent app crash for bad requests
This commit is contained in:
@@ -171,6 +171,10 @@ export default {
|
||||
},
|
||||
async logout() {
|
||||
if (this.user) {
|
||||
if (this.$store.getters['getIsPlayerOpen']) {
|
||||
this.$eventBus.$emit('close-stream')
|
||||
}
|
||||
|
||||
await this.$nativeHttp.post('/logout').catch((error) => {
|
||||
console.error('Failed to logout', error)
|
||||
})
|
||||
|
||||
@@ -143,8 +143,6 @@ export default {
|
||||
this.comicHasMetadata = false
|
||||
this.registerListeners()
|
||||
this.hideToolbar()
|
||||
|
||||
console.log('showReader for ebookFile', JSON.stringify(this.ebookFile))
|
||||
} else {
|
||||
this.unregisterListeners()
|
||||
this.$showHideStatusBar(true)
|
||||
@@ -435,7 +433,9 @@ export default {
|
||||
await VolumeButtons.watchVolume(options, this.volumePressed)
|
||||
}
|
||||
} else if (isWatching.value) {
|
||||
await VolumeButtons.clearWatch()
|
||||
await VolumeButtons.clearWatch().catch((error) => {
|
||||
console.error('Failed to clear volume watch', error)
|
||||
})
|
||||
}
|
||||
|
||||
this.isInittingWatchVolume = false
|
||||
@@ -450,7 +450,9 @@ export default {
|
||||
this.$eventBus.$on('close-ebook', this.closeEvt)
|
||||
document.body.removeEventListener('touchstart', this.touchstart)
|
||||
document.body.removeEventListener('touchend', this.touchend)
|
||||
VolumeButtons.clearWatch()
|
||||
VolumeButtons.clearWatch().catch((error) => {
|
||||
console.error('Failed to clear volume watch', error)
|
||||
})
|
||||
},
|
||||
volumePressed(e) {
|
||||
if (this.ereaderSettings.navigateWithVolume == 'enabled') {
|
||||
|
||||
Reference in New Issue
Block a user