mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-07-12 23:14:48 +02:00
Fix:Native back button go back or ask before quitting #52, Fix:Appbar back button
This commit is contained in:
parent
6c08e91dfc
commit
d3a2c79a55
8 changed files with 42 additions and 7 deletions
|
@ -1,6 +1,23 @@
|
|||
import Vue from 'vue'
|
||||
import { App } from '@capacitor/app'
|
||||
import { Dialog } from '@capacitor/dialog'
|
||||
import { formatDistance, format } from 'date-fns'
|
||||
|
||||
App.addListener('backButton', async ({ canGoBack }) => {
|
||||
if (!canGoBack) {
|
||||
const { value } = await Dialog.confirm({
|
||||
title: 'Confirm',
|
||||
message: `Did you want to exit the app?`,
|
||||
})
|
||||
if (value) {
|
||||
App.exitApp()
|
||||
}
|
||||
|
||||
} else {
|
||||
window.history.back()
|
||||
}
|
||||
});
|
||||
|
||||
Vue.prototype.$eventBus = new Vue()
|
||||
|
||||
Vue.prototype.$isDev = process.env.NODE_ENV !== 'production'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue