mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2026-08-09 05:18:40 +02:00
Improvements and fixes on the cellular permissions
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user