mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-07-25 13:14:33 +02:00
Android & iOS only open most recent session on first load
This commit is contained in:
parent
aab44d8cee
commit
d899fd4d89
3 changed files with 23 additions and 6 deletions
|
@ -43,6 +43,9 @@ export default {
|
|||
bookmarks() {
|
||||
if (!this.serverLibraryItemId) return []
|
||||
return this.$store.getters['user/getUserBookmarksForItem'](this.serverLibraryItemId)
|
||||
},
|
||||
isIos() {
|
||||
return this.$platform === 'ios'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -266,12 +269,17 @@ export default {
|
|||
onReady() {
|
||||
// The UI is reporting elsewhere we are ready
|
||||
this.isReady = true
|
||||
this.notifyOnReady()
|
||||
|
||||
// TODO: iOS opens last active playback session on app launch. Should be consistent with Android
|
||||
if (this.isIos) {
|
||||
this.notifyOnReady()
|
||||
}
|
||||
},
|
||||
notifyOnReady() {
|
||||
// If settings aren't loaded yet, native player will receive incorrect settings
|
||||
console.log('Notify on ready... settingsLoaded:', this.settingsLoaded, 'isReady:', this.isReady)
|
||||
if (this.settingsLoaded && this.isReady) {
|
||||
if (this.settingsLoaded && this.isReady && this.$store.state.isFirstAudioLoad) {
|
||||
this.$store.commit('setIsFirstAudioLoad', false) // Only run this once on app launch
|
||||
AbsAudioPlayer.onReady()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue