mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2026-08-04 02:48:54 +02:00
Fix:Back button closing modals and fullscreen player #535
This commit is contained in:
@@ -849,7 +849,7 @@ export default {
|
||||
document.documentElement.style.setProperty('--title-author-left-offset-collapsed', 24 + coverImageWidthCollapsed + 'px')
|
||||
},
|
||||
minimizePlayerEvt() {
|
||||
this.showFullscreen = false
|
||||
this.collapseFullscreen()
|
||||
},
|
||||
showProgressSyncIsFailing() {
|
||||
this.syncStatus = this.$constants.SyncStatus.FAILED
|
||||
|
||||
@@ -215,17 +215,18 @@ Vue.prototype.$setOrientationLock = (orientationLockSetting) => {
|
||||
}
|
||||
|
||||
export default ({ store, app }, inject) => {
|
||||
inject('eventBus', new Vue())
|
||||
const eventBus = new Vue()
|
||||
inject('eventBus', eventBus)
|
||||
|
||||
// iOS Only
|
||||
// backButton event does not work with iOS swipe navigation so use this workaround
|
||||
if (app.router && Capacitor.getPlatform() === 'ios') {
|
||||
app.router.beforeEach((to, from, next) => {
|
||||
if (store.state.globals.isModalOpen) {
|
||||
Vue.prototype.$eventBus.$emit('close-modal')
|
||||
eventBus.$emit('close-modal')
|
||||
}
|
||||
if (store.state.playerIsFullscreen) {
|
||||
Vue.prototype.$eventBus.$emit('minimize-player')
|
||||
eventBus.$emit('minimize-player')
|
||||
}
|
||||
next()
|
||||
})
|
||||
@@ -234,11 +235,11 @@ export default ({ store, app }, inject) => {
|
||||
// Android only
|
||||
App.addListener('backButton', async ({ canGoBack }) => {
|
||||
if (store.state.globals.isModalOpen) {
|
||||
Vue.prototype.$eventBus.$emit('close-modal')
|
||||
eventBus.$emit('close-modal')
|
||||
return
|
||||
}
|
||||
if (store.state.playerIsFullscreen) {
|
||||
Vue.prototype.$eventBus.$emit('minimize-player')
|
||||
eventBus.$emit('minimize-player')
|
||||
return
|
||||
}
|
||||
if (!canGoBack) {
|
||||
|
||||
Reference in New Issue
Block a user