mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-06-30 17:14:39 +02:00
Fix:iOS swipe navigation to close modal
This commit is contained in:
parent
505717e580
commit
3be13025a8
3 changed files with 24 additions and 8 deletions
|
@ -120,7 +120,22 @@ Vue.prototype.$encode = encode
|
|||
const decode = (text) => Buffer.from(decodeURIComponent(text), 'base64').toString()
|
||||
Vue.prototype.$decode = decode
|
||||
|
||||
export default ({ store }) => {
|
||||
export default ({ store, app }) => {
|
||||
// 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')
|
||||
}
|
||||
if (store.state.playerIsFullscreen) {
|
||||
Vue.prototype.$eventBus.$emit('minimize-player')
|
||||
}
|
||||
next()
|
||||
})
|
||||
}
|
||||
|
||||
// Android only
|
||||
App.addListener('backButton', async ({ canGoBack }) => {
|
||||
if (store.state.globals.isModalOpen) {
|
||||
Vue.prototype.$eventBus.$emit('close-modal')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue