mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-08-05 18:45:47 +02:00
Improvements and fixes on the cellular permissions
This commit is contained in:
parent
574dda5286
commit
4ad54f34fe
9 changed files with 94 additions and 72 deletions
|
@ -56,6 +56,7 @@
|
|||
import { Capacitor } from '@capacitor/core'
|
||||
import { Dialog } from '@capacitor/dialog'
|
||||
import { AbsFileSystem, AbsDownloader } from '@/plugins/capacitor'
|
||||
import cellularPermissionHelpers from '@/mixins/cellularPermissionHelpers'
|
||||
|
||||
export default {
|
||||
async asyncData({ store, params, redirect, app }) {
|
||||
|
@ -115,6 +116,7 @@ export default {
|
|||
startingDownload: false
|
||||
}
|
||||
},
|
||||
mixins: [cellularPermissionHelpers],
|
||||
computed: {
|
||||
transformedDescription() {
|
||||
return this.parseDescription(this.description)
|
||||
|
@ -419,6 +421,9 @@ export default {
|
|||
async downloadClick() {
|
||||
if (this.downloadItem || this.startingDownload) return
|
||||
|
||||
const hasPermission = await this.checkCellularPermission('download')
|
||||
if (!hasPermission) return
|
||||
|
||||
this.startingDownload = true
|
||||
setTimeout(() => {
|
||||
this.startingDownload = false
|
||||
|
|
|
@ -171,6 +171,7 @@
|
|||
import { Dialog } from '@capacitor/dialog'
|
||||
import { AbsFileSystem, AbsDownloader } from '@/plugins/capacitor'
|
||||
import { FastAverageColor } from 'fast-average-color'
|
||||
import cellularPermissionHelpers from '@/mixins/cellularPermissionHelpers'
|
||||
|
||||
export default {
|
||||
async asyncData({ store, params, redirect, app, query }) {
|
||||
|
@ -221,6 +222,7 @@ export default {
|
|||
startingDownload: false
|
||||
}
|
||||
},
|
||||
mixins: [cellularPermissionHelpers],
|
||||
computed: {
|
||||
isIos() {
|
||||
return this.$platform === 'ios'
|
||||
|
@ -607,9 +609,11 @@ export default {
|
|||
this.download(localFolder)
|
||||
},
|
||||
async downloadClick() {
|
||||
if (this.downloadItem || this.startingDownload) {
|
||||
return
|
||||
}
|
||||
if (this.downloadItem || this.startingDownload) return
|
||||
|
||||
const hasPermission = await this.checkCellularPermission('download')
|
||||
if (!hasPermission) return
|
||||
|
||||
this.startingDownload = true
|
||||
setTimeout(() => {
|
||||
this.startingDownload = false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue